Goldman SachsOA #16
Find the Damaged Toy
估计简单可在线判题
考点(AI 标注)位运算模拟/实现
N children numbered 1..N sit in a circle. The first toy goes to child D, and the remaining toys are handed out one at a time in increasing order of number, wrapping around to 1. Find who receives the T-th (last) toy.
输入格式
A single line containing N T D. This site adds 1≤N,T≤10^9 and 1≤D≤N.
输出格式
Output the 1-based number of the child who receives the last toy.
样例 1
输入:
5 2 1
输出:
2
样例 2
输入:
5 1 4
输出:
4
样例 3
输入:
3 7 2
输出:
2