-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhacker-cup.py
98 lines (96 loc) · 1.02 KB
/
hacker-cup.py
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
test = """
7
1 1 3
0 2 4
5 5 1
0 1 1
1 1 2
97 1 99
97 1 100
""".strip()
input = """
79
1 1 3
0 2 4
5 5 1
0 1 1
1 1 2
97 1 99
97 1 100
100 100 1
1 1 100
73 11 11
51 80 87
95 29 33
3 18 73
95 86 44
90 64 52
45 6 51
22 100 82
9 1 74
54 9 68
25 69 4
65 29 2
65 33 82
27 86 80
72 83 70
59 91 43
44 6 85
70 16 86
91 45 24
43 53 30
24 12 7
12 84 24
45 44 1
33 89 88
24 100 92
46 75 43
83 33 45
95 2 83
64 71 56
90 61 18
100 12 73
69 59 26
80 60 87
45 68 27
29 57 87
99 84 12
44 87 73
56 88 12
50 37 94
48 7 24
6 62 41
96 100 52
4 98 23
95 99 98
57 36 14
14 86 12
27 99 25
85 1 7
20 29 31
88 99 37
14 12 85
78 95 78
63 24 100
33 70 75
49 85 72
95 35 54
50 61 9
45 25 96
7 74 43
62 56 8
69 10 27
45 68 4
6 42 16
5 40 27
14 29 22
91 25 96
65 58 100
52 62 52
80 9 18
14 52 10
""".strip()
lines = [[int(x) for x in line.split()] for line in input.splitlines()[1:]]
for i, (single, double, decks) in enumerate(lines, 1):
P = "YES" if single + (2 * double) >= decks and (single * 2) + (double * 2) >= decks + 1 else "NO"
print(f"Case #{i}: {P}")