-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathLecture - 34.cpp
More file actions
35 lines (34 loc) · 803 Bytes
/
Lecture - 34.cpp
File metadata and controls
35 lines (34 loc) · 803 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
//
// main.cpp
// Lecture 34
//
// Created by Prince Kumar on 17/04/19.
// Copyright © 2019 Prince Kumar. All rights reserved.
// -- * Problems from codechef -> Train Partner -- ANKTRAIN * -//
#include <iostream>
using namespace std;
int main()
{
int T; cin>>T;
while(T--)
{
int n; // berth number
cin>>n;
if(n%8==0)
{cout<<n-1<<"SL"<<endl;}
else if(n%8==7)
{cout<<n+1<<"SU"<<endl;}
else if(n%8==1)
{cout<<n+3<<"LB"<<endl;}
else if(n%8==4)
{cout<<n-3<<"LB"<<endl;}
else if(n%8==2)
{cout<<n+3<<"MB"<<endl;}
else if(n%8==5)
{cout<<n-3<<"MB"<<endl;}
else if(n%8==3)
{cout<<n+3<<"UB"<<endl;}
else if(n%8==6)
{cout<<n-3<<"UB"<<endl;}
}
}