13 1 s 128 MB
Input consists of several test cases. The first line of whole input contains a single integer T, the number of test cases.
Then T test cases follow. The first line of each test case contains a single integer N. Then N lines follow, describing each building with three space-separated integers Ai, Bi, and Hi .
For each test case, write a single line which contains the total area, in square units, of the silhouettes formed by all N buildings.
1 4 2 5 1 9 10 4 6 8 2 4 6 3