logo AlgoBeat OnlineJudge
登录 注册

#217582. [ICPC 2019 Yinchuan R] So Easy

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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.

输入格式

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 a single integer, the hidden element.

样例

样例输入 1

3
1 2 1
0 -1 0
0 1 0

样例输出 1

1