Skip to content

Commit fdd4e30

Browse files
authored
Create Save_the_Prisoner.py
1 parent f0ed325 commit fdd4e30

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Save_the_Prisoner.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
for i in range(input()):
2+
a,b,c = map(int, raw_input().split())
3+
d = (c + (b % a) - 1)%a
4+
if d > 0:
5+
print d
6+
else:
7+
print a

0 commit comments

Comments
 (0)