题目描述
Problem Description
Given an integer $ N $, determine whether there exists a tuple of subsets $ (S_1, S_2, ..., S_k) $ of $\{1, 2, ..., N\}$ that satisfies the following conditions, and if so, construct one such tuple.
- Each integer from $ 1, 2, ..., N $ is contained in exactly 2 of the subsets $ S_1, S_2, ..., S_k $.
- Any two sets from $ S_1, S_2, ..., S_k $ have exactly 1 element in common.
Input Format
The input is given from the standard input in the following format:
$ N $
Output Format
If no such tuple of subsets exists, output No. If it exists, first output Yes, then output the information of the subsets in the following format. Let $S_i = \{S_{i,1}, S_{i,2}, ..., S_{i,|S_i|}\}$.
If there are multiple valid solutions, you may output any one of them.
$ k $ $ |S_1| $ $ S_{1,1} $ $ S_{1,2} $ $ ... $ $ S_{1,|S_1|} $ $ : $ $ |S_k| $ $ S_{k,1} $ $ S_{k,2} $ $ ... $ $ S_{k,|S_k|} $
Sample Input and Output
Sample Input #1
3
Sample Output #1
Yes
3
2 1 2
2 3 1
2 2 3
Sample Input #2
4
Sample Output #2
No
Notes/Hints
Constraints
- $1 \leq N \leq 10^5$
- $ N $ is an integer.
Sample Explanation 1
$(S_1, S_2, S_3) = (\{1, 2\}, \{3, 1\}, \{2, 3\})$ satisfies the conditions.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分