-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcnote.java
More file actions
33 lines (32 loc) · 998 Bytes
/
Copy pathcnote.java
File metadata and controls
33 lines (32 loc) · 998 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
import java.util.Scanner;
class cnote {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
for (int i = 0; i < t; i++) {
int x = scan.nextInt();
int y = scan.nextInt();
int k = scan.nextInt();
int n = scan.nextInt();
boolean flag = false;
for (int j = 0; j < n; j++) {
int page = scan.nextInt();
int price = scan.nextInt();
if (page >= x-y) {
if( price <= k){
flag = true;
}
}// else {
// // flag=false;
// continue;
// }
}
//System.out.println(flag);
if (flag == true) {
System.out.println("LuckyChef");
} else {
System.out.println("UnluckyChef");
}
}
}
}