#include<stdio.h>
#include<stdlib.h>
int main(void){
int n,k,m,i,j,a[100],sign,count;
scanf("%d%d%d",&n,&k,&m);
for(i=0;i<n;i++)
a[i]=i+1;
sign=k+m-2;
count=n;
while(count>1){
if(sign>=n)
sign=sign-n;
for(i=0;i<n;i++){
if(a[i]==a[sign]){
for(j=i;j<n;j++)
a[j]=a[j+1];
}
break;
}
sign=i+m;
count--;
}
printf("%d",a[0]);
return 0;
}
全部评论
(0) 回帖