#abc200d. D - Happy Birthday! 2(WAITING SPJ)
D - Happy Birthday! 2(WAITING SPJ)
Score : points
问题描述
给定一个包含 个正整数的序列:。确定是否存在满足所有条件的一对序列 $B = (B_1, B_2, \dots, B_x), C = (C_1, C_2, \dots, C_y)$,如果存在,则打印出这样一对序列。
- 。
- 。
- 。
- 序列 和 不相同。
- 在这里,当 或存在一个整数 使得 时,我们认为 和 是不同的序列。
- 与 对 取模后的结果相等。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a sequence of positive integers: . Determine whether there is a pair of sequences $B = (B_1, B_2, \dots, B_x), C = (C_1, C_2, \dots, C_y)$ satisfying all of the conditions, and print one such pair if it exists.
- .
- .
- .
- and are different sequences.
- Here, we consider and different when or there is an integer such that .
- and are equal modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
If there is no pair of sequences satisfying the conditions, print a single line containing No
.
Otherwise, print your choice of and in the following format:
Yes
The checker is case-insensitive: you can use either uppercase or lowercase letters.
Sample Input 1
5
180 186 189 191 218
Sample Output 1
Yes
1 1
2 3 4
For , we have , which are equal modulo . There are other solutions that will also be accepted, such as:
yEs
4 2 3 4 5
3 1 2 5
Sample Input 2
2
123 523
Sample Output 2
Yes
1 1
1 2
Sample Input 3
6
2013 1012 2765 2021 508 6971
Sample Output 3
No
If there is no pair of sequences satisfying the conditions, print a single line containing No
.
update @ 2024/3/10 09:11:52