#GYM104669C. Max Permutation
Max Permutation
Description
Keys is trying to solve this very difficult question. He is too busy watching anime so he doesn't have enough time to solve the problem. He needs your help.
Given an integer $n$, print a permutation where the number of distinct values of $p_i \cdot i$ is maximized.
Note that the permutation is $1$ indexed ($i$ starts from $1$ and goes to $n$).
You can print any answer that works.
The first and only line contains a single number $n$, $1 \le n \le 2 \cdot 10^5$.
The first and only line should contain $n$ spaces separated integers denoting a permutation of length $n$.
Input
The first and only line contains a single number $n$, $1 \le n \le 2 \cdot 10^5$.
Output
The first and only line should contain $n$ spaces separated integers denoting a permutation of length $n$.
4
5
7
3 4 2 1
5 4 3 1 2
6 5 4 2 1 3 7
Note
In the first test case one valid permutation is $[3, 4, 2, 1]$. When we multiply this by $[1, 2, 3, 4]$ we get $[3, 8, 6, 4]$ which gives us $4$ distinct values which is the max for this value of $n$.