#arc140c. [arc140_c]ABS Permutation (LIS ver.)
[arc140_c]ABS Permutation (LIS ver.)
Problem Statement
The happiness of a permutation of is defined as follows.
- Let be a sequence of length with . The happiness of is the length of a longest strictly increasing subsequence of .
Print a permutation such that with the greatest happiness.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print a permutation such that with the greatest happiness, in the following format:
If there are multiple solutions, printing any of them will be accepted.
Sample Input 1
3 2
Sample Output 1
2 1 3
Since , the happiness of is , which is the greatest happiness achievable, so the output meets the requirement.
Sample Input 2
3 1
Sample Output 2
1 2 3
Since , the happiness of is , which is the greatest happiness achievable, so the output meets the requirement.