Home STD Contest Notification Clarification Problems Ranklist Status Print Sign Out
题目已经加到OJ的4493~4499和4597~4599More...

Rectangle

Time Limit: 10000/10000 MS (Java/Others)    Memory Limit: 65535/102400 K (Java/Others)
Total Submission(s): 46    Accepted Submission(s): 17


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
1 4 4 abab dacb adab cabb
 

Sample Output
6
 

Statistic | Submit | Clarifications | Back