시간 제한
메모리 제한
시간 제한
1초
메모리 제한
128 MB

Now, Stancu has a difficult task – he promised to his bosses to decrypt the coding of Peter and to find the number of inner modules of the station. Unfortunately, he is not experienced enough. Help him. Write a program to solve the task.
On the first line of the input file the number T of the test cases will be given. Each test case starts with a line containing the number N of the outside modules (3 ≤ N ≤ 1024). Then N – 1 lines follow. On the first of these lines the distances from outside module 1 to the outside modules 2, 3,…, N are given, separated by single spaces. On the second line are given, also separated by single spaces, the distances from outside module 2 to the outside modules 3, 4,…, N, and so on. The last line contains only the distance from the outside module N – 1 to the outside module N.
For each test case the program has to print on a separate line of the standard output the number M of the inner modules of the station. In all test cases M will be less than 1024.