Run ID:80827
提交时间:2024-07-11 16:31:58
#include<bits/stdc++.h> using namespace std; int main() { int n,m; int i=0,t=0; int a[1001]={0}; cin>>n>>m; int c=n; while(c>0) { i++; if(i>n) { i=1; } if(a[i]==0) { t++; if(t==m) { a[i]=1; t=0; c--; cout<<i<<" "; } } } return 0; }