#include <cstdio>
#include <iostream>
#define SIZE 105
using namespace std;
int read(){
int x = 0, f =1;
char c = getchar();
while (c<'0'||c>'9') {
if (c=='-') {
f = -1;
}
c = getchar();
}
while (c>='0'&&c<='9') {
x = x*10 + c - '0';
c = getchar();
}
return x*f;
}
int queue[SIZE];
int main(){
int n = read(),m = read();
int count = 0;
int step = 1;
for (int i = 1; count!=n;) {
if (i>n) {
i = 1;
}
if (step>m) {
step=1;
}
if (queue[i]==1) {
//cout<<"p:"<<i<<"跳"<<endl;
i++;
continue;
}
if (step==m) {
printf("%d ",i);
queue[i]=1;
count++;
}
//cout<<"p:"<<i<<" "<<step<<endl;
i++;
step++;
}
return 0;
}
网友评论