#abc362c. C - Sum = 0
C - Sum = 0
Score : points
问题陈述
给定 对整数 。
确定是否存在一个序列 个整数 满足以下条件,并在存在时打印出这样的一个序列。
- 对于每个 ,有 。
- 。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
You are given pairs of integers .
Determine whether there exists a sequence of integers that satisfies the following conditions, and print one such sequence if it exists.
- for each .
- .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
If no solution exists, print No
. Otherwise, print an integer sequence that satisfies the conditions in the following format:
Yes
If multiple solutions exist, any of them will be considered correct.
Sample Input 1
3
3 5
-4 1
-2 3
Sample Output 1
Yes
4 -3 -1
The sequence satisfies all the conditions. Other valid sequences include and .
Sample Input 2
3
1 2
1 2
1 2
Sample Output 2
No
No sequence satisfies the conditions.
Sample Input 3
6
-87 12
-60 -54
2 38
-76 6
87 96
-17 38
Sample Output 3
Yes
-66 -57 31 -6 89 9