-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathseating.c
More file actions
41 lines (36 loc) · 723 Bytes
/
Copy pathseating.c
File metadata and controls
41 lines (36 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//seating arrangement in train
//please, switch to switch case. I didn't have time!
#include <stdio.h>
int main(){
int T, N, r;
scanf("%d", &T);
while(T--)
{
scanf("%d", &N);
r = N%12;
if(r==0)
printf("%d WS \n", N-11);
else if(r==6)
printf("%d WS\n", N+1);
else if(r==1)
printf("%d WS\n", N+11);
else if(r==7)
printf("%d WS\n", N-1);
else if(r==2)
printf("%d MS\n", N+9);
else if(r==4)
printf("%d AS\n", N+5);
else if(r==3)
printf("%d AS\n", N+7);
else if(r==5)
printf("%d MS\n", N+3);
else if(r==8)
printf("%d MS\n", N-3);
else if(r==9)
printf("%d AS\n", N-5);
else if(r==10)
printf("%d AS\n", N-7);
else if(r==11)
printf("%d MS\n", N-9);
}
}