-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbablu_dablu.java
More file actions
50 lines (48 loc) · 1.06 KB
/
bablu_dablu.java
File metadata and controls
50 lines (48 loc) · 1.06 KB
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
44
45
46
47
48
49
50
import java.io.*;
import java.util.*;
import java.lang.*;
public class bablu_dablu
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int testcase=sc.nextInt();
while(testcase--!=0)
{
int n=sc.nextInt();
int temp=n%8;
if(temp==0)
{
System.out.println((n-1)+"SL");
}
else if(temp==1)
{
System.out.println((n+3)+"LB");
}
else if(temp==2)
{
System.out.println((n+3)+"MB");
}
else if(temp==3)
{
System.out.println((n+3)+"UB");
}
else if(temp==4)
{
System.out.println((n-3)+"LB");
}
else if(temp==5)
{
System.out.println((n-3)+"MB");
}
else if(temp==6)
{
System.out.println((n-3)+"UB");
}
else if(temp==7)
{
System.out.println((n+1)+"SU");
}
}
}
}