-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDark_Light.java
More file actions
57 lines (43 loc) · 1.28 KB
/
Copy pathDark_Light.java
File metadata and controls
57 lines (43 loc) · 1.28 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
import java.util.*;
/**
* Dark_Light
*/
public class Dark_Light {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for (int i = 0; i < t; i++)
{
int n = sc.nextInt();
int k = sc.nextInt();
// if(k != 0 && (n >=1 || n <= 3) )
// {
// System.out.println("Ambiguous");
// }
// else
// {
// for(int j = 0; j< n;j++)
// {
// k = k+1;
// }
// System.out.println(k);
if(n >= 1 && k>=1)
{
System.out.println("Ambiguous");
}
else
{
k = k+n;
if(k == 0 || k==4)
{
System.out.println("Off");
}
else if(k >= 1 || k <= 3)
{
System.out.println("On");
}
}
}
sc.close();
}
}