|
||||||||||
RectangleTime Limit: 10000/10000 MS (Java/Others) Memory Limit: 65535/102400 K (Java/Others)Total Submission(s): 674 Accepted Submission(s): 254 Problem Description Given a rectangle which contains N rows and each of them contains a string length of M. You must find out a symmetrical isosceles right triangle (with two equal edges and a right angle) with two edges parallel two side of the rectangle. Symmetry means the value should be the same according to the shortest altitude of the triangle. And just output the area of the triangle. Input The first line of the input contains an integer T (1 <= T <= 20), which mean there are T test case follow. For each test case, the first line contains two integer number N and M (1 <= N, M <= 500) which means described above. And then N lines follow, which contains a string of length M. The string only contains letters or digits. Output For each test case, output a single integer that is the answer to the problem described above. Sample Input
Sample Output
Source | ||||||||||
|