solved save the prisoner
Signed-off-by: ayham <altffour@protonmail.com>
This commit is contained in:
parent
011e4c0458
commit
f022ff3558
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue