AtCoder Regular Contest 115
B
Plus Matrix
AtCoder
⌀ 629
原题
← AC →
翻译中…

Problem Statement

翻译中…

Given is an $N \times N$ matrix $C$ whose elements are non-negative integers. Determine whether there is a pair of sequences of non-negative integers $A_1,A_2,\ldots,A_N$ and $B_1,B_2,\ldots,B_N$ such that $C_{i,j}=A_i+B_j$ for every $(i, j)$. If the answer is yes, print one such pair.

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq 500$
  • $0 \leq C_{i,j} \leq 10^9$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
C_{1,1} C_{1,2} \ldots C_{1,N}
C_{2,1} C_{2,2} \ldots C_{2,N}
:
C_{N,1} C_{N,2} \ldots C_{N,N}

翻译中…

Output

翻译中…
  • If no pair $A, B$ satisfies the condition:
翻译中…

Print No in the first line.

翻译中…

No

翻译中…
  • If some pair $A, B$ satisfies the condition:
翻译中…

In the first line, print Yes. In the second line, print the elements of $A$, with spaces in between. In the third line, print the elements of $B$, with spaces in between.

翻译中…

If multiple pairs satisfy the condition, any of them will be accepted.

翻译中…

Yes
A_1 A_2 \ldots A_N
B_1 B_2 \ldots B_N

翻译中…

样例

Input #1
3
4 3 5
2 1 3
3 2 4
Output #1
Yes
2 0 1
2 1 3
Note that $A$ and $B$ consist of non-negative integers.
Input #2
3
4 3 5
2 2 3
3 2 4
Output #2
No
题目信息
题号
arc115_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。