~/algor $ cat problems/navbat-doira-boylab-sanash
Counting around a circle
Easy
1000 ms
128 MB
29%
$n$ people stand in a circle, numbered from $1$ to $n$. Counting starts from person $1$: $k$ people are counted clockwise, and the $k$-th person counted leaves the circle. The next count starts from the person after them, and so on, until everyone has left. Determine the order in which the people leave.
Input
One line with two positive integers: $n$ and $k$.
Output
One line with $n$ numbers separated by spaces — the order of leaving.
Note
$1 \le n, k \le 2000$
Examples
Input #1
7 3
Output #1
3 6 2 7 5 1 4
Input #2
1 1
Output #2
1