{"trustable":false,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eRobert is a famous engineer. One day he was given a task by his boss. The background of the task was the following:\u003cbr\u003e \u003cbr\u003e Given a map consisting of square blocks. There were three kinds of blocks: Wall, Grass, and Empty. His boss wanted to place as many robots as possible in the map. Each robot held a laser weapon which could shoot to four directions (north, east, south, west) simultaneously. A robot had to stay at the block where it was initially placed all the time and to keep firing all the time. The laser beams certainly could pass the grid of Grass, but could not pass the grid of Wall. A robot could only be placed in an Empty block. Surely the boss would not want to see one robot hurting another. In other words, two robots must not be placed in one line (horizontally or vertically) unless there is a Wall between them.\u003cbr\u003e \u003cbr\u003e Now that you are such a smart programmer and one of Robert\u0027s best friends, He is asking you to help him solving this problem. That is, given the description of a map, compute the maximum number of robots that can be placed in the map.\u003c/p\u003e\n \u003cbr\u003e现在要在一个地图中,摆放机器人。每个机器人启动之后会向左右上下四个方向发生激光。机器人只能放在空地上。如何摆放机器人,使得其他之间不会攻击到对方。同一行或者同一列的机器人会伤害到对方(除非中间有墙)。\n \n \n "}},{"title":"","value":{"format":"HTML","content":" \u003cp\u003e\u003cb\u003e\u003cbr\u003e Input\u003c/b\u003e\u003cbr\u003e \u003cbr\u003e The first line contains an integer T (\u0026lt;\u003d 11) which is the number of test cases. \u003cbr\u003e \u003cbr\u003e For each test case, the first line contains two integers m and n (1\u0026lt;\u003d m, n \u0026lt;\u003d50) which are the row and column sizes of the map. Then m lines follow, each contains n characters of \u0027#\u0027, \u0027*\u0027, or \u0027o\u0027 which represent Wall, Grass, and Empty, respectively. \u003c/p\u003e\n\u003cbr\u003e 第一行一个整数,表示测试数据组数,不超过11组。\n\u003cbr\u003e对于每组测试数据,第一行两个整数n,m,表示地图的行数和列数。\n\u003cbr\u003e接下来n行,每行m个字符,‘#’,‘*’,‘o’分别表示 墙,草坪和空地。"}},{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\u003cbr\u003e \u003cb\u003eOutput\u003c/b\u003e\u003cbr\u003e \u003cbr\u003e For each test case, first output the case number in one line, in the format: \"Case :id\" where id is the test case number, counting from 1. In the second line just output the maximum number of robots that can be placed in that map.\u003c/p\u003e\n\u003cbr\u003e对于每组数据,输出最多可以放下的机器人。具体格式,见样例。"}},{"title":"","value":{"format":"HTML","content":" \u003cp\u003e\u003cbr\u003e \u003cb\u003eSample Input\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003e2\u003cbr\u003e 4 4\u003cbr\u003e o***\u003cbr\u003e *###\u003cbr\u003e oo#o\u003cbr\u003e ***o\u003cbr\u003e 4 4\u003cbr\u003e #ooo\u003cbr\u003e o#oo\u003cbr\u003e oo#o\u003cbr\u003e ***#\u003c/p\u003e "}},{"title":"","value":{"format":"HTML","content":" \u003cp\u003e\u003cbr\u003e \u003cb\u003eSample Output\u003c/b\u003e\u003c/p\u003e \n \u003cp\u003eCase :1\u003cbr\u003e 3\u003cbr\u003e Case :2\u003cbr\u003e 5\u003c/p\u003e \n \u003cp\u003e\u003cbr\u003e \u003c/p\u003e "}}]}