#P8397. [CCC 2022 S3] Good Samples

[CCC 2022 S3] Good Samples

Problem Description

Note: the notes in the score are numbers.

We define a subscore as a “non-empty contiguous sequence of notes”. That is, after sorting a sequence and removing duplicates, the difference between every two adjacent values is 11.

For example, (3,4,2)(3,4,2), (1,2,3,4,2)(1,2,3,4,2), and (4)(4) are subscores of (1,2,3,4,2)(1,2,3,4,2).

Note that (1,3)(1,3) is not a subscore.

If two subscores start or end at different positions in the piece, we call them “different subscores”.

If all numbers at any two positions in a subscore are different, we call it a “good subscore”.

The performers are very picky, and they require the following for the score:

  1. All notes must be less than mm.
  2. There are kk good subscores in the score.

They now ask you whether you can construct such a score.

Input Format

The first line contains three integers n,m,kn, m, k. Their meanings are described in the statement.

Output Format

Output one line with nn integers, representing the score required by the performers.

If there are one or more valid scores, output the lexicographically smallest one. If it is impossible to construct a score that satisfies the requirements, output -1.

3 2 5
1 2 1
5 5 14
1 5 3 2 1
5 5 50
-1

Hint

For 20%20\% of the testdata: 1n161 \le n \le 16, m=2m = 2, 1k10001 \le k \le 1000.

For another 20%20\% of the testdata: 1n1061 \le n \le 10^6, m=2m = 2, 1k10181 \le k \le 10^{18}.

For another 25%25\% of the testdata: 1n1061 \le n \le 10^6, m=nm = n, 1k10181 \le k \le 10^{18}.

For 100%100\% of the testdata: 1n1061 \le n \le 10^6, 1mn1 \le m \le n, 1k10181 \le k \le 10^{18}.

Translated by ChatGPT 5