#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,n,p,test,i,j,k,l,ans;
cin>>test;
for(l=1;l<=test;l++)
{
cin>>n>>k;
cin>>p;
for(i=k;i<=(k+p);i++)
{
a=i;
}
ans=a%n;
printf("Case %d: ",l);
if(ans==0)
cout<<n<<endl;
else
cout<<ans<<endl;
}
return 0;
}
using namespace std;
int main()
{
int a,b,c,n,p,test,i,j,k,l,ans;
cin>>test;
for(l=1;l<=test;l++)
{
cin>>n>>k;
cin>>p;
for(i=k;i<=(k+p);i++)
{
a=i;
}
ans=a%n;
printf("Case %d: ",l);
if(ans==0)
cout<<n<<endl;
else
cout<<ans<<endl;
}
return 0;
}
No comments:
Post a Comment