M items are to be delivered in a circle of size N. Find the position where the M-th item will be delivered if we start from a given position K. Note that items are distributed at adjacent positions starting from K.
The first line consists of an integer T i.e number of test cases. The first and last line of each test case contains three integers N,M and K.
Print the position where the Mth item will be delivered.
5 2 1
5 8 2
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.