Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: dddrrrr
Problemset: ของขวัญและขโมย
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-17 22:45:12
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n ,k ,t;
cin >> n >> k >> t;
int i=1 ,cnt=1;
while(true){
i += k;
i %= n;
if(i == 1)break;
cnt++;
if(i == t)break;
}
cout << cnt;
return 0;
}