File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ //
2
+ // main.cpp
3
+ // Lecture 34
4
+ //
5
+ // Created by Prince Kumar on 17/04/19.
6
+ // Copyright © 2019 Prince Kumar. All rights reserved.
7
+ // -- * Problems from codechef -> Train Partner -- ANKTRAIN * -//
8
+
9
+ #include < iostream>
10
+ using namespace std ;
11
+ int main ()
12
+ {
13
+ int T; cin>>T;
14
+ while (T--)
15
+ {
16
+ int n; // berth number
17
+ cin>>n;
18
+ if (n%8 ==0 )
19
+ {cout<<n-1 <<" SL" <<endl;}
20
+ else if (n%8 ==7 )
21
+ {cout<<n+1 <<" SU" <<endl;}
22
+ else if (n%8 ==1 )
23
+ {cout<<n+3 <<" LB" <<endl;}
24
+ else if (n%8 ==4 )
25
+ {cout<<n-3 <<" LB" <<endl;}
26
+ else if (n%8 ==2 )
27
+ {cout<<n+3 <<" MB" <<endl;}
28
+ else if (n%8 ==5 )
29
+ {cout<<n-3 <<" MB" <<endl;}
30
+ else if (n%8 ==3 )
31
+ {cout<<n+3 <<" UB" <<endl;}
32
+ else if (n%8 ==6 )
33
+ {cout<<n-3 <<" UB" <<endl;}
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments