Professional Documents
Culture Documents
1002
1002
Description
Johan wants to build a new house and he wants his house as large as it can.
Given an N x N grid land, find the largest square size that fit in the free area.
Input specification
The first line of input contains an integer T (1 <= T <= 100), the number of test cases follow. Each
test case starts with an integer N denoting the size of the grid land. The next N lines each contains
N characters. Each character be either '.' (free area) or '#' (obstacle). Your house should be build on
free area.
Output specification
For each test case, output in a line the size of the largest square on free area.
Sample input
2
10
..........
.#####....
..#..###..
...##.....
...#..#...
...#...###
....######
..........
##########
#########.
5
##..#
....#
.#..#
####.
.#..#
Caribbean Online Judge
-1-
Sample output
3
2
Hint(s)
Source ACM-ICPC INC 2009
Added by ejaltuna
Addition date 2011-10-13 07:11:23.0
Time limit (ms) 1000
Test limit (ms) 1000
Memory limit (kb) 130000
Output limit (mb) 64
Size limit (bytes) 10000
Enabled languages
Bash C C# C++ Java Pascal Perl PHP
Python Ruby
Caribbean Online Judge
-2-