P27173 [AtCoder] Not Say "NO"
提高-
题目描述

Problem Description

First, read the following problem:

There are $ N $ children numbered $1, 2, \dots, N$, and $ K $ presents with different values among them. The value of the $ i $-th present is $ V_i $. When distributing all the presents to the children, can we ensure that each child ends up with presents of the same total value? If possible, output YES and show an example of how to distribute the presents. If not, output NO.

Constraints

  • $1 \le N \le 100$
  • $2 \times N - 1 \le K \le 10^4$
  • $1 \le V_i \le 10^{14} (1 \le i \le K)$
  • $V_i \neq V_j (1 \le i < j \le K)$

Given $ N $ and $ K $, generate a test case for this problem along with an example solution. However, you must not generate a case where the solution is NO. It can be shown that under these constraints, there is always a solution for any input.

Input Format

The input is given from the standard input in the following format:

$ N $ $ K $

Output Format

Output in the following format:

$ V_1 $ $ V_2 $ $\cdots$ $ V_K $ $ S $ $ R_1 $ $ R_2 $ $\cdots$ $ R_K $

First, output the generated test case $ V_i $ on the first line.

Next, output the solution $ S $ for the test case. $ S $ must be either YES or NO, but you must not generate a case where the solution is NO.

Finally, if $ S $ is YES, show an example of how to distribute the presents. If $R_i = X (1 \le X \le N)$, it means the $ i $-th present is given to the $ R_i $-th child.

Sample Input and Output

Sample Input #1

3 6

Sample Output #1

3 5 2 6 4 1
YES
3 2 2 1 3 1

Sample Input #2

2 5

Sample Output #2

100 10 20 30 40
YES
2 1 1 1 1

Notes/Hints

Explanation

Not Say "NO" - Explanation

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 6
样例输出
3 5 2 6 4 1 YES 3 2 2 1 3 1