转圈报数
#include <iostream>
#include <vector>
#include <stack>
#include <set>
#include <string>
#include <algorithm>
using namespace std;
int main(void) {
int m, n;
while (cin>>m>>n) {
vector<int> ans(m);
for (int i = 1; i <= m;i++) {
ans[i - 1] = i;
}
int i = 1;
while (ans.size() > 1) {
i = (i+n-1) % ans.size();
cout << ans[i];
ans.erase(ans.begin() + i);
}
cout << endl<<ans[0] << endl;
}
return 0;
}