atcoder#ARC115B. [ARC115B] Plus Matrix
[ARC115B] Plus Matrix
Score : points
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
3
4 3 5
2 1 3
3 2 4
Yes
2 0 1
2 1 3
Note that and consist of non-negative integers.
3
4 3 5
2 2 3
3 2 4
No