#arc115b. [arc115_b]Plus Matrix
[arc115_b]Plus Matrix
Problem Statement
Given is an matrix whose elements are non-negative integers. Determine whether there is a pair of sequences of non-negative integers and such that for every . If the answer is yes, print one such pair.
Constraints
Input
Input is given from Standard Input in the following format:
Output
- If no pair satisfies the condition:
Print No
in the first line.
No
- If some pair satisfies the condition:
In the first line, print Yes
. In the second line, print the elements of , with spaces in between. In the third line, print the elements of , with spaces in between.
If multiple pairs satisfy the condition, any of them will be accepted.
Yes
Sample Input 1
3
4 3 5
2 1 3
3 2 4
Sample Output 1
Yes
2 0 1
2 1 3
Note that and consist of non-negative integers.
Sample Input 2
3
4 3 5
2 2 3
3 2 4
Sample Output 2
No