forked from harshitbansal373/c-plus-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc&constructor.cpp
More file actions
43 lines (42 loc) · 754 Bytes
/
func&constructor.cpp
File metadata and controls
43 lines (42 loc) · 754 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
41
42
43
#include <iostream>
using namespace std;
class partner{
public:
void findpartner();
};
void partner::findpartner(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int b;
b=n/8;
if(n%8==1 || n%8==4){
if(n%8==1){
cout<<(b+1)*8-4<<"LB"<<endl;
}
else{
cout<<(b+1)*8-7<<"LB"<<endl;
}
}
else if(n%8==2 || n%8==5){
if(n%8==2){
cout<<(b+1)*8-3<<"MB"<<endl;
}
else{cout<<(b+1)*8-6<<"MB"<<endl;}
}
else if(n%8==3 || n%8==6){
if(n%8==3){cout<<(b+1)*8-2<<"UB"<<endl;}
else{cout<<(b+1)*8-5<<"UB"<<endl;}
}
else{if(n%8==7){cout<<(b+1)*8<<"SU"<<endl;}
else{cout<<(b+1)*8-1<<"SL"<<endl;}}
n=0;b=0;
}
}
int main() {
partner obj;
obj.findpartner();
return 0;
}