#ABC478E. 小于与小于等于 / lt and le
小于与小于等于 / lt and le
Problem Statement
Determine whether there exists an integer sequence of length consisting of integers between and , inclusive, that satisfies all of the following conditions, and if it exists, find one.
The -th condition is given by a triple of integers , and is defined as follows.
- If :
- If :
If there are multiple sequences satisfying all conditions, you may output any of them.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
On the first line, output Yes if an integer sequence satisfying the conditions exists, and No otherwise. If you output Yes on the first line, choose one integer sequence satisfying the conditions and output its elements, separated by spaces, on the second line. If there are multiple sequences satisfying all the conditions, you may choose any of them.
7 8
0 1 4
0 2 6
0 3 2
1 3 5
0 4 1
0 4 3
1 5 7
0 6 7
Yes
1 4 2 1 3 5 6
Let ; this is an integer sequence of length consisting of integers between and , inclusive. Here, for example, the first condition holds since . The other seven conditions also hold, so the output corresponding to is considered correct.
Additionally, , , and others also satisfy the conditions, so outputting these is also considered correct.
1 1
1 1 1
No
There is no integer sequence such that holds.
15 20
0 9 8
1 6 1
0 6 8
0 11 1
0 4 2
1 11 12
0 4 14
1 10 1
0 12 12
1 7 12
1 13 1
1 5 9
1 10 14
1 14 1
1 8 12
0 10 12
1 4 15
1 3 9
0 5 14
0 10 2
Yes
15 14 10 7 6 5 4 12 11 3 2 13 1 9 8
- Source: AtCoder ABC 478 E
相关
在下列比赛中: