-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarioAndTransformation.java
More file actions
62 lines (47 loc) · 1.37 KB
/
MarioAndTransformation.java
File metadata and controls
62 lines (47 loc) · 1.37 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
51
52
53
54
55
56
57
58
59
60
61
62
/*
Mario and Transformation
Mario transforms each time he eats a mushroom as follows:
If he is currently small, he turns normal.
If he is currently normal, he turns huge.
If he is currently huge, he turns small.
Given that Mario was initially normal, find his size after eating X mushrooms.
Input Format
The first line of input will contain one integer T, the number of test cases. Then the test cases follow.
Each test case contains a single line of input, containing one integer X.
Output Format
For each test case, output in a single line Mario's size after eating X mushrooms.
Print:
NORMAL, if his final size is normal.
HUGE, if his final size is huge.
SMALL, if his final size is small.
Constraints
1 ≤ T ≤ 100
1 ≤ X ≤ 100
Sample Input
3
2
4
12
Sample Output
SMALL
HUGE
NORMAL
*/
import java.util.Scanner;
public class MarioAndTransformation {
public static void main(String[] args) throws java.lang.Exception {
// your code goes here
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 0; i < n; i++) {
int x = sc.nextInt();
if (x % 3 == 2 || x == 2) {
System.out.println("SMALL");
} else if (x % 3 == 0 || x == 0) {
System.out.println("NORMAL");
} else {
System.out.println("HUGE");
}
}
}
}