#P4495. Rectangle

    ID: 3369 远端评测题 10000ms 100MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>2013 ACM-ICPC吉林通化全国邀请赛——题目重现

Rectangle

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.

1 4 4 abab dacb adab cabb
6