403763: GYM101262 C Vera and Mean Sorting

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

Description

C. Vera and Mean Sortingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

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

M(i) = H(Ai, ..., Ai + K - 1)

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

Input

The input will be in the format:

N K

Output

Output one line with the desired permutation. If such permutation does not exist output one line with 0.

ExamplesInput
3 2
Output
2 3 1
Input
4 1
Output
0

加入题单

上一题 下一题 算法标签: