class Solution {
public:
/**
*
* @param n int整型
* @param m int整型
* @return int整型
*/
int ysf(int n, int m) {
int last{0},ans{};
for(int i=1;i<=n;++i)
{
ans=(last+m)%i==0?i:(last+m)%i;
last=ans;
}
return ans;
// write code here
}
};