Pro.ID21847 TitlePool construction Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21847 AC8 Submit8 Ratio100.00% 时间&空间限制描述You are working for the International Company for Pool Construction, a construction company which specializes in building swimming pools. A new client wants to build several new pool areas. A pool area is a rectangular grid of w × h square patches, consisting of zero or more (possibly disconnected) pools. A pool consists of one or multiple connected hole patches, which will later be filled with water. In the beginning, you start with a piece of land where each patch is either a hole in the ground ('.') or flat grass ('#'). In order to transform this land into a pool area, you must adhere to the following:
You are given the task of calculating the cost of the cheapest possible pool area given the layout of the existing piece of land. 输入On the first line a positive integer: the number of test cases, at most 100. After that per test case:
输出Description You are working for the International Company for Pool Construction, a construction company which specializes in building swimming pools. A new client wants to build several new pool areas. A pool area is a rectangular grid of w × h square patches, consisting of zero or more (possibly disconnected) pools. A pool consists of one or multiple connected hole patches, which will later be filled with water. In the beginning, you start with a piece of land where each patch is either a hole in the ground ('.') or flat grass ('#'). In order to transform this land into a pool area, you must adhere to the following:
You are given the task of calculating the cost of the cheapest possible pool area given the layout of the existing piece of land. Input On the first line a positive integer: the number of test cases, at most 100. After that per test case:
Output Per test case: one line with an integer: the cost of building the cheapest possible pool area from the original piece of land. Sample Input 3 Sample Output 9 Source 样例输入3 样例输出9 作者 |