初来报道,问一个算法问题。
请问这题应该用什么算法解决?
You are given a M*M cloth with some holes on it.Your task is to find a biggest square cloth from it.
Input
There are several test cases.For each case,the first line contains the one integer number M(1<=M<=1000).Then M lines are following.Each line contains M characters which "." means cloth and "H" means hole.When M=0,it means the end of the input.
Out put
For each test case,your program should output the only line containing the area of the biggest square cloth.
Sample Input
5
H...H
.....
.....
.HHH.
.....
4
....
.HH.
....
0
Sample Output
9
1