{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees,factories and buildings. There is still some space in the area that is unoccupied. The strategic task of his game is to win as much rent money from these free spaces. To win rent money you must erect buildings, that can only be rectangular, as long and wide as you can. Bob is trying to find a way to build the biggest possible building in each area. But he comes across some problems – he is not allowed to destroy already existing buildings, trees, factories and streets in the area he is building in. \n \u003cbr\u003eEach area has its width and length. The area is divided into a grid of equal square units.The rent paid for each unit on which you\u0027re building stands is 3$. \n \u003cbr\u003eYour task is to help Bob solve this problem. The whole city is divided into K areas. Each one of the areas is rectangular and has a different grid size with its own length M and width N.The existing occupied units are marked with the symbol R. The unoccupied units are marked with the symbol F.\n\n \u003cbr\u003eBob是一名战略游戏编程专家。在他的新城市建设游戏中,游戏环境如下:城市由区域建立,其中有街道,树木,工厂和建筑物。该地区仍有一些空间无人居住。他的比赛的战略任务是从这些自由空间中赢得尽可能多的租金。要赢得租金,你必须建造尽可能长而宽的矩形建筑物。鲍勃正试图找到一种方法来建造每个区域最大的建筑物。但他遇到了一些问题 - 他不允许销毁他正在建造的地区已有的建筑物,树木,工厂和街道。\n每个区域都有宽度和长度。该区域被划分为一个相等的平方单位网格。您建造的每个单位的租金为3美元。\n你的任务是帮助Bob解决这个问题。整个城市分为K区。每个区域都是矩形的,具有不同的网格大小,其长度为M,宽度为N.现有的占用单元用符号R标记。未占用的单元用符号F标记。\n \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n The first line of the input contains an integer K – determining the number of datasets. Next lines contain the area descriptions. One description is defined in the following way: The first line contains two integers-area length M\u0026lt;\u003d1000 and width N\u0026lt;\u003d1000, separated by a blank space. The next M lines contain N symbols that mark the reserved or free grid units,separated by a blank space. The symbols used are: \n \u003cbr\u003eR – reserved unit \n \u003cbr\u003eF – free unit \n \u003cbr\u003eIn the end of each area description there is a separating line.\n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n For each data set in the input print on a separate line, on the standard output, the integer that represents the profit obtained by erecting the largest building in the area encoded by the data set. \n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e2\n5 6\nR F F F F F\nF F F F F F\nR R R F F F\nF F F F F F\nF F F F F F\n\n5 5\nR R R R R\nR R R R R\nR R R R R\nR R R R R\nR R R R R\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e45\n0\u003c/pre\u003e"}}]}