#C7072. Beautiful Permutation
Beautiful Permutation
Beautiful Permutation
You are given two integers n and k. A beautiful permutation is defined as a permutation of the integers from 1 to n such that if n is less than k then no valid permutation exists. Otherwise, the beautiful permutation is simply the sequence of numbers from 1 to n in increasing order.
Formally, if we denote the permutation as \(a_1, a_2, \ldots, a_n\), then for \(n \ge k\) you should output:
[ a_1 = 1,; a_2 = 2,; \ldots,; a_n = n ]
and if \(n < k\) output -1.
Input/Output Format: The input consists of two space-separated integers n and k from standard input. The output should be printed to standard output. If a valid permutation exists, output the permutation numbers separated by a single space. Otherwise, output -1.
inputFormat
The input consists of a single line containing two space-separated integers n and k (1 \(\le\) n, k \(\le\) 106).
outputFormat
If \(n \ge k\), print the numbers 1 through n (i.e. the beautiful permutation) separated by spaces. Otherwise, print -1.
## sample5 3
1 2 3 4 5
</p>