atcoder#ARC135B. [ARC135B] Sum of Three Terms
[ARC135B] Sum of Three Terms
Score : points
Problem Statement
You are given a sequence of integers . Determine whether there is a sequence of integers that satisfies the conditions below.
- for every ().
- for every ().
If it exists, print one such sequence.
Constraints
Input
Input is given from Standard Input from the following format:
Output
If there is a sequence that satisfies the conditions, print Yes
; otherwise, print No
.
In the case of Yes
, print an additional line containing the elements of such a sequence , separated by spaces.
If there are multiple sequences satisfying the conditions, you may print any of them.
5
6 9 6 6 5
Yes
0 4 2 3 1 2 2
We can verify that for every (), as follows.
- .
- .
- .
- .
- .
5
0 1 2 1 0
No
1
10
Yes
0 0 10