#include<stdio.h>
int main()
{
int z,nm,c,f,i,s;
scanf("%d",&z);
for(i=0;i<z;i++){
scanf("%d%d%d",&nm,&c,&f);
if((f+c)%nm==1 || nm==1){
printf("%d\n",nm);
}
else if((f+c)%nm==0) {
printf("%d\n", nm-1);
}
else{
printf("%d\n", (f+c)%nm-1);
}
}
}
#include<stdio.h>
int main()
{
int z,nm,c,f,i,s;
scanf("%d",&z);
for(i=0;i<z;i++){
scanf("%d%d%d",&nm,&c,&f);
if((f+c)%nm==1 || nm==1){
printf("%d\n",nm);
}
else if((f+c)%nm==0) {
printf("%d\n", nm-1);
}
else{
printf("%d\n", (f+c)%nm-1);
}
}
}
Hi friends....
In this blog I'm going to give answer for daily test skillrack program, daily challenges and kick start programs and give some coding techniques.
It'll be helpful for u sure and make it usefull
Learn More →
0 Comments