#MTHA0000010. Lịch trực luân phiên (Rotating Duty Schedule)
Lịch trực luân phiên (Rotating Duty Schedule)
Rotating Duty Schedule
Version: Phuoc Hung OJ Extended
Problem Statement
There are duty teams numbered from to . Team is on duty on day . Each following day moves to the next team, wrapping from team to team . Determine the team on duty on day .
Input
One line contains three integers , , and .
Output
Print the team number on duty on day .
Subtasks
- Subtask 1 (30 points):
- .
- .
- Subtask 2 (70 points):
- .
- .
Examples
Example 1
Input
5 2 1
Output
2
Explanation
On day no transition has happened, so team is on duty.
Example 2
Input
5 2 5
Output
1
Explanation
The duty sequence from day to day is , so day uses team .
Example 3
Input
7 7 100
Output
1
Explanation
There are transitions after day ; , so one step from team reaches team .