PROGRAMMING:Homogeneous squares
Assume you have a square of size n that is divided into n × n positions just as a checkerboard. Two positions (x1,y1) and (x2,y2), where 1 ≤ x1,y1,x2,y2 ≤ n, are called "independent" if they occupy different rows and different columns, that is, x1≠x2 and y1≠y2.
Suppose you have a square of size n, which is divided into n × N positions, like a chessboard. Two positions (x1, Y1) and (X2, Y2), if 1 ≤ x1, Y1, X2, Y2 ≤ n, then it is called "independent", that is, x1 ≠ X2, Y1 ≠ Y2.
More generally, n positions are called independent if they are pairwise independent. It follows that there are n! different ways to choose n independent positions.
More generally, if n positions are independent in pairs, they are called independent. So there's n! Different methods of selecting n independent positions.
Assume further that a number is written in each position of such an n × n square. This square is called "homogeneous" if the sum of the numbers written in n independent positions is the same, no matter how the positions are chosen.
It is further assumed that in n × Write a number for each position of n square. If the sum of the numbers in n independent positions is the same, no matter how these positions are selected, this square is called "homogeneous".
Write a program to determine if a given square is homogeneous!
Write a program to determine whether a given box is homogeneous!
###* * input format * *:
The input contains several test cases.
The input contains several test cases.
The first line of each test case contains an integer n (1 ≤ n ≤ 1000). Each of the next n lines contains n numbers, separated by exactly one space character. Each number is an integer from the interval [-1000000,1000000].
The first line of each test case contains an integer n (1 ≤ n ≤ 1000). The next N lines contain n numbers, separated by a space character. The value range of each number is [− 100000010000000].
The last test case is followed by a zero.
The last test case is followed by a zero.
###* * output format * *:
For each test case output whether the specified square is homogeneous or not. Adhere to the format shown in the sample output.
For each test case output, whether the specified box is homogeneous. Follow the format shown in the sample output.
### **Sample Input**:
```in
two
1 2
3 4
three
1 3 4
8 6 -2
-3 4 0
0
```
### **Sample Output**:
```out
homogeneous
not homogeneous
```
answer:If there is no answer, please comment
Suppose you have a square of size n, which is divided into n × N positions, like a chessboard. Two positions (x1, Y1) and (X2, Y2), if 1 ≤ x1, Y1, X2, Y2 ≤ n, then it is called "independent", that is, x1 ≠ X2, Y1 ≠ Y2.
More generally, n positions are called independent if they are pairwise independent. It follows that there are n! different ways to choose n independent positions.
More generally, if n positions are independent in pairs, they are called independent. So there's n! Different methods of selecting n independent positions.
Assume further that a number is written in each position of such an n × n square. This square is called "homogeneous" if the sum of the numbers written in n independent positions is the same, no matter how the positions are chosen.
It is further assumed that in n × Write a number for each position of n square. If the sum of the numbers in n independent positions is the same, no matter how these positions are selected, this square is called "homogeneous".
Write a program to determine if a given square is homogeneous!
Write a program to determine whether a given box is homogeneous!
###* * input format * *:
The input contains several test cases.
The input contains several test cases.
The first line of each test case contains an integer n (1 ≤ n ≤ 1000). Each of the next n lines contains n numbers, separated by exactly one space character. Each number is an integer from the interval [-1000000,1000000].
The first line of each test case contains an integer n (1 ≤ n ≤ 1000). The next N lines contain n numbers, separated by a space character. The value range of each number is [− 100000010000000].
The last test case is followed by a zero.
The last test case is followed by a zero.
###* * output format * *:
For each test case output whether the specified square is homogeneous or not. Adhere to the format shown in the sample output.
For each test case output, whether the specified box is homogeneous. Follow the format shown in the sample output.
### **Sample Input**:
```in
two
1 2
3 4
three
1 3 4
8 6 -2
-3 4 0
0
```
### **Sample Output**:
```out
homogeneous
not homogeneous
```
answer:If there is no answer, please comment