## Vera and Mean Sorting

View as PDF

Points: 10
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
##### 2017 Winter Waterloo Local ACM Contest, Problem C

The harmonic mean of a sequence of positive integers is Vera classifies an array of positive integers of length as -mean-sorted if for where A permutation is an ordered set of integers , consisting of distinct positive integers, each of which are at most .

Permutation is lexicographically smaller than permutation if there is ( ), such that , and for any ( ) .

Given integers and , help Vera find the lexicographically smallest permutation of integers to such that is -mean-sorted but not -mean-sorted for .

If no such permutation exists output .

#### Constraints

• • • are integers

#### Input Specification

The input will be in the format:  #### Output Specification

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

#### Sample Input 1

3 2

#### Sample Output 1

2 3 1

#### Sample Input 2

4 1

#### Sample Output 2

0