Skip to content

Commit e39af69

Browse files
Seating Arrangement
1 parent 94efd13 commit e39af69

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

HackerEarth/Seating-Arrangement.py

+45-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,48 @@
5454
CONSTRAINTS
5555
1<=T<=105
5656
1<=N<=108
57-
'''
57+
'''
58+
59+
'''
60+
# Sample code to perform I/O:
61+
62+
name = input() # Reading input from STDIN
63+
print('Hi, %s.' % name) # Writing output to STDOUT
64+
65+
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
66+
'''
67+
68+
# Write your code here
69+
T = int(input())
70+
71+
while T:
72+
N = int(input())
73+
74+
seat = N%12
75+
76+
if seat == 1:
77+
print(N + 11, 'WS')
78+
elif seat == 2:
79+
print(N + 9, 'MS')
80+
elif seat == 3:
81+
print(N + 7, 'AS')
82+
elif seat == 4:
83+
print(N + 5, 'AS')
84+
elif seat == 5:
85+
print(N + 3, 'MS')
86+
elif seat == 6:
87+
print(N + 1, 'WS')
88+
elif seat == 7:
89+
print(N - 1, 'WS')
90+
elif seat == 8:
91+
print(N - 3, 'MS')
92+
elif seat == 9:
93+
print(N - 5, 'AS')
94+
elif seat == 10:
95+
print(N - 7, 'AS')
96+
elif seat == 11:
97+
print(N - 9, 'MS')
98+
else:
99+
print(N - 11, 'WS')
100+
101+
T -= 1

0 commit comments

Comments
 (0)