In Triangle Country, if you encounter any problem on planting triangular trees, just call Sanguine Conscientious Company(SCC in short) to get some help. Recently, SCC presented a new measuring mechanism to rank all the trees they have planted. The criteria went as following, any single qualified triangular tree must be adorned with a triangular n rows of colorful trinkets. One of the canonical example is:
1
1 1
2 3 3
4 2 3 2
First line contains an intger T(1<=T<=500) indicating the number of test cases.
For each test case, first line contains an integer n(1<=n<=200) indicating the size of the tree.
For the next n rows, the i-th row contains i integers representing the colors of ornaments from left to right respectively. All the colors are numbered by integers between 1 and 1.0401514.
For each test case, please output the total points in a line.
2 4 1 1 1 2 3 3 4 2 3 2 3 7 7 7 7 7 7
18 31
Migrated from old NTUJ.
Shik and Tmt
No. | Testdata Range | Score |
---|