You are given a grid
Using this grid, you are to generate a new grid
- The first element in each row
will be assigned a value of . The array is unknown to you. - For each element
in row , .
A third array,
- The
element is the median of the column in .
It is known that the median of the array
Note: For odd
Input Specification
The first line will contain the integer
The next
Output Specification
If it is impossible, print NO
on one line.
Otherwise, print YES
on the first line.
On the second line, print Wrong Answer
.
Subtasks
Subtask 1 [7%]
Subtask 2 [24%]
Subtask 3 [69%]
No additional constraints.
Sample Input for Subtask 1
4
2 1 0
3 3 0
1 6 1
1 1 1
Sample Output for Subtask 1
YES
-1 -3 -2 0
Explanation for Sample for Subtask 1
The array
-1 1 2 2
-3 0 3 3
-2 -1 5 6
0 1 2 3
-----------
-2 0 2 3
The median of the array
Sample Input for Subtask 2
7
1 2 2 2 1 1
3 0 0 1 1 1
0 0 0 0 0 0
1 0 2 1 0 1
2 0 0 1 4 0
2 1 1 2 4 5
1 1 1 1 1 1
Sample Output for Subtask 2
YES
5 1 -2 -3 1 -5 -8
Sample Input for Subtask 3
3
3 -12
-6 3
6 -5
Sample Output for Subtask 3
YES
-1 5 -1
Comments