atcoder#TENKA12018D. Crossing
Crossing
Score : points
Problem Statement
You are given an integer . Determine if there exists a tuple of subsets of , , that satisfies the following conditions:
- Each of the integers is contained in exactly two of the sets .
- Any two of the sets have exactly one element in common.
If such a tuple exists, construct one such tuple.
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
If a tuple of subsets of that satisfies the conditions does not exist, print No
.
If such a tuple exists, print Yes
first, then print such subsets in the following format:
where .
If there are multiple such tuples, any of them will be accepted.
3
Yes
3
2 1 2
2 3 1
2 2 3
It can be seen that satisfies the conditions.
4
No