#P17633. [ICPC 2019 Yinchuan R] So Easy
[ICPC 2019 Yinchuan R] So Easy
Problem Description
Mr. G invents a new game whose rules are given as follows.
Firstly, he has an matrix, all elements of which are initially. Then, he follows up with some operations: in each time he chooses a row or a column, and adds an arbitrary positive integer to all the elements in the selected row or column. When all operations have been finished, he hides an element in the matrix and the element is modified to .
Now given the final matrix, you are asked to find out what the hidden element should be before the very last hiding operation.
Input Format
The first line contains a single integer .
Next lines represent the matrix after the operations. Each element in the matrix satisfies , and exactly one element is .
Output Format
Output a single integer, the hidden element.
3
1 2 1
0 -1 0
0 1 0
1