You are viewing a single comment's thread. Return to all comments →
solution in C:
int main() { int t,prisoners,sweets,starting_chair,res; scanf("%d",&t);
while(t--) { scanf("%d %d %d",&prisoners,&sweets,&starting_chair); res = (sweets - 1 + starting_chair - 1) % prisoners + 1; printf("%d\n",res); } return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Save the Prisoner!
You are viewing a single comment's thread. Return to all comments →
solution in C:
include
int main() { int t,prisoners,sweets,starting_chair,res; scanf("%d",&t);
}