Problem1732--约瑟夫问题

1732: 约瑟夫问题

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

n个人排成一圈,从第一个人开始报数,报到m的人退出,请问最后剩下的人是原本的第几个

Input

第一行多少人n
第二行报到多少退出m

Output

剩下的人是原本第几个

Sample Input Copy

10
2

Sample Output Copy

5

Source/Category

数组