#include<iostream>
typedef unsigned long long ull;
using namespace std;
int n,m,num;
bool b[10000];
int a[100000],c[1000000];
void s(){
int r=n,i=1,cnt=0;
while(r>0){
if(b[i]==0){
num++;
if(num==m) cnt++,cout<<i<<' ',b[i]=1,r--,num=0;
}
i++;
if(i>n) i=1;
}
}
int main(){
cin>>n>>m;
s();
}
你谷 P1996 题解
赞赏