| Stanford ProCo 2021 |
|---|
| Закончено |
The Stanford Axe Committee, which is in charge of guarding the Stanford Axe, is holding tryouts for new members in preparation for the annual faceoff against Cal. Applicants are numbered 1 through $$$N$$$ and come to try out. As the committee lines everyone up to call them in for an interview, the Stanford tree waltzes by and issues the first challenge:
Rearrange yourselves such that the longest increasing subsequence is of length $$$X$$$ and the longest decreasing subsequence must be of length $$$Y$$$, or say it's impossible.
Can you help the applicants pass their first test?
Definition: A subsequence of an array is defined as any array that can be reachable by deleting some number of elements. For example, if we have array [4, 2, 7, 5, 1], valid subsequences include [4, 7, 1] and [2, 7], but not [2, 4] or [3, 7, 5].
The input consists of $$$3$$$ space separated integers, $$$N$$$, $$$X$$$, and $$$Y$$$ ($$$1 \leq X, Y \leq N \leq 10^3$$$).
Output one line containing your permutation of the integers $$$1$$$ to $$$N$$$. If there is no such permutation, output $$$-1$$$.
10 4 5
7 6 3 2 5 9 10 4 1 8
5 1 1
-1
Given a sequence of elements, a subsequence is a subset of these elements in the same order. An increasing subsequence means every element is greater than the element before it. For example, the largest increasing subsequence of $$$1, 2, 5, 4, 3, 6, 9, 7, 8$$$ is of length 6, such as $$$1, 2, 3, 6, 7, 8$$$.
| Название |
|---|


