P13295 [CodeChef] passsys
NOI
题目描述

Note: For Turbo C++, select "Text" as your language

Problem Description:
In IIIT we use password system to unlock the lab doors and only Mtech students are given the password for these labs. Password system comprises of nn keypad where n is odd.
One day Ashish saw an Mtech student using the password. He figured out that the password is symmetric about the centre point ( centre point for n
n keypad will be point with co-ordinates (n/2, n/2) according to 0 based indexing or (n/2+1, n/2+1) according to 1 based indexing). Now he has to try all possible symmetric combinations to unlock the door. Since he has not enough time he asks you to tell if given password is symmetric or not.
You will be given n*n binary grid containing elements as 0 if that key is not used and 1 if that key is used. You need to tell whether the given binary grid is symmetric according to the centre point.

Input
First line contains an integer t denoting number of test cases.
Each test case begin with an integer n denoting the size of the grid.
Next n line contains n space separated integers. Each integer is 1 or 0 depending on if that button is pressed for that password or not.

Output
For each test case output single line containing “Yes” or “No” depending on whether the given password is symmetric or not.

Constraints

1 ≤ T ≤ 10
1 ≤ n ≤ 100

Example
Input:
3
3
1 1 0
0 0 0
0 1 1
3
1 1 0
0 0 0
1 1 0
3
1 0 1
1 0 0
0 0 0

Output:
Yes
No
No

Explanation
Example case 1. Since the given password is symmetric along centre point so ans is Yes.
Example case 2. Since the given password is not symmetric along centre point so ans is No.

输入格式

见题面

输出格式

见题面

样例输入
3 3 1 1 0 0 0 0 0 1 1 3 1 1 0 0 0 0 1 1 0 3 1 0 1 1 0 0 0 0 0
样例输出
Yes No No