Run ID:164151
提交时间:2026-11-01 09:58:54
#include<bits/stdc++.h> using namespace std; int main() { int n,m,sr=0; bool j[101]={}; cin>>n>>m; int i=0,bs=0; while(sr!=n-1){ i++; if(i>n)i=1; if(!j[i])bs++; if(bs==m){ bs=0; j[i]=true; sr++; cout<<i<<' '; } } return 0; }