The harmonic mean of a sequence of positive integers x1,x2,…,xN is
H(x1,…,xN)=(N∑i=1Nxi−1)−1
For an array of positive integers A=[A1,…,AN] of length N, let
M(i)=H(Ai,Ai+1,…,Ai+K−1)
Vera calls A K-mean-sorted if M(i)≥M(i+1) holds for every i with 1≤i≤N−K.
A permutation P is an ordered list of N distinct positive integers P1,P2,…,PN, each of them at most N.
Permutation P is lexicographically smaller than permutation Q if there is an i (1≤i≤N) with Pi<Qi such that Pj=Qj for every j with 1≤j<i.
You are given the integers N and K. Among the permutations P of the integers 1 through N that are K-mean-sorted and are not L-mean-sorted for any L (1≤L≤N−1) with L=K, help Vera find the lexicographically smallest one. If no such permutation exists, print 0.