-->
当前位置:首页 > 题库

PROGRAMMING:Special Joseph problem

Luz5年前 (2021-05-10)题库392
N children with numbers of 1... N play games. They form a circle clockwise according to the numbers, count the number from the first person in counter clockwise order, and report to the m person; Then start from the next person to count in clockwise order and report to the k-th person; Then start from the next person to count counter clockwise and report to the m-th person; Then start counting from the next person in clockwise order, report to the k-th person, and so on, until the last person is listed. Please write a program to output the number of the listed person in order.
![ pic.jpg](~/bba20cff-26eb-4fc1-bc02-5e09871642ad.jpg)
###Input format:
The input is three positive integers, representing n, m and K respectively, all no more than 1000.
###Output format:
The output is a row of integers, which is the number of the listed person. One space after each integer.
###Input example:
```in
6 3 5
```
###Output example:
```out
5 3 1 2 4 6
```







answer:If there is no answer, please comment