#include<stdio.h>
int main()
{
int i,n,k,p,t;
while(scanf("%d", &t) != EOF)
{
for(i=1;i<=t;i++)
{
scanf("%d %d %d", &n, &k, &p);
k = k+p;
while(k>n)
{
k = k-n;
}
printf("Case %d: %d\n", i, k);
}
}
return 0;
}
int main()
{
int i,n,k,p,t;
while(scanf("%d", &t) != EOF)
{
for(i=1;i<=t;i++)
{
scanf("%d %d %d", &n, &k, &p);
k = k+p;
while(k>n)
{
k = k-n;
}
printf("Case %d: %d\n", i, k);
}
}
return 0;
}
Comments
Post a Comment