408305: GYM103091 E Longest Sequences

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Longest Sequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

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].

Input

The input consists of $$$3$$$ space separated integers, $$$N$$$, $$$X$$$, and $$$Y$$$ ($$$1 \leq X, Y \leq N \leq 10^3$$$).

Output

Output one line containing your permutation of the integers $$$1$$$ to $$$N$$$. If there is no such permutation, output $$$-1$$$.

ExamplesInput
10 4 5
Output
7 6 3 2 5 9 10 4 1 8
Input
5 1 1
Output
-1
Note

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$$$.

加入题单

上一题 下一题 算法标签: