solved save the prisoner

Signed-off-by: ayham <altffour@protonmail.com>
This commit is contained in:
ayham 2021-05-10 08:30:47 +03:00
parent 011e4c0458
commit f022ff3558
No known key found for this signature in database
GPG Key ID: 81D38F7122AFCC94
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, m, s;
cin >> t;
while (t--) {
cin >> n >> m >> s;
cout << ((s+m-2)%n)+1 << endl;
}
return 0;
}