No.942 Distributing Presents
Problem Statement
yuki, the king of the Yuki Kingdom, has prepared $N$ presents for the coming Christmas.
Each present has a value called its "worth", and the worth of the $i~(1 \leq i \leq N)$-th present is $i$.
There are currently $K$ children in the Yuki Kingdom.
yuki wants to distribute the prepared presents to the children of the kingdom so that all of the following conditions are satisfied.
- Each child receives the same number of presents
- The sum of the worth of the presents received is the same for each child
yuki has asked you, the chancellor of the kingdom, whether such a distribution exists and, if it does, how the presents should be distributed.
Constraints
- $1 \leq N \leq 200000$
- $1 \leq K \leq N$
- $K$ is a divisor of $N$
- All inputs are integers
Input
The input is given from standard input in the following format.
$N$ $K$
Output
If no distribution of presents satisfying the conditions exists, print No.
If one exists, print Yes, then a newline, and then print $K$ more lines.
Here, on the $i + 1$-th line of the output, print the numbers of the presents received by the $i$-th child, separated by spaces.
If there are multiple distributions satisfying the conditions, any of them will be accepted.
Sample
Sample 1
Input
4 2
Output
Yes
2 3
1 4
Sample 2
Input
6 2
Output
No
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
ei13337
ei1333333