Preparing NOJ

Rectangle

10000ms 102400K

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

Info

HDU

Provider HDU

Origin 2013 ACM-ICPC吉林通化全国邀请赛――题目重现

Code HDU4495

Tags

Submitted 51

Passed 9

AC Rate 17.65%

Date 06/03/2019 16:44:00

Related

Nothing Yet