Run ID:81010
提交时间:2024-07-12 08:36:03
#include<iostream> using namespace std; int a[1005]; int main(){ int n,m; cin>>n>>m; int cnt=0,t=0,i=1; while(cnt<n){ if(a[i]==0){ t++; if(t==m){ cnt++; cout<<i<<" "; a[i]=1; t=0; } } i++; if(i>n){ i=1; } } }