403763: GYM101262 C Vera and Mean Sorting
Description
The harmonic mean of a sequence of positive integers x1, ..., xN is
Vera thinks that an array of positive integers A = [A1, ..., AN] of length N is K-mean-sorted if M(i) ≥ M(i + 1) for 1 ≤ i ≤ N - K where
A permutation P is an ordered set of integers P1, P2, ..., PN, consisting of N distinct positive integers, each of them doesn't exceed N. We'll call number N the size or the length of permutation.
Permutation P is lexicographically smaller than permutation Q if there is i (1 ≤ i ≤ n), such that Pi < Qi, and for any j (1 ≤ j < i) Pj = Qj.
Given integers N and K, help Vera find the lexicographically smallest permutation P of integers 1 to N such that P is K-mean-sorted but not L-mean-sorted for 1 ≤ L ≤ N - 1, L ≠ K.
If no such permutation exists output 0.
Constraints:
2 ≤ N ≤ 100
1 ≤ K ≤ N - 1
N, K are integers
InputThe input will be in the format:
N K
OutputOutput one line with the desired permutation. If such permutation does not exist output one line with 0.
ExamplesInput3 2Output
2 3 1Input
4 1Output
0