mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
16 lines
241 B
C++
16 lines
241 B
C++
|
#include <stdio.h>
|
||
|
int main()
|
||
|
{
|
||
|
int n,m,i,j;
|
||
|
while(scanf("%d %d",&n,&m)!=EOF)
|
||
|
{
|
||
|
for(i=0,j=-1;i<m;i++)
|
||
|
{
|
||
|
j+=1;
|
||
|
j%=n;
|
||
|
}
|
||
|
printf("%d\n",j);
|
||
|
}
|
||
|
return 1;
|
||
|
}
|