-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path658A.py
45 lines (33 loc) · 912 Bytes
/
658A.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
io = input().split()
n = int(io[0])
c = int(io[1])
scores = list(map(int, input().split()))
times = list(map(int, input().split()))
def limak(scores, times):
points = 0
curr_time = times[0]
for i in range(n):
points += max(0, scores[i] - (c * curr_time))
if len(times) > i + 1:
curr_time += times[i + 1]
else:
break
return points
def radewoosh(scores, times):
points = 0
curr_time = times[-1]
for i in range(n - 1, -1, -1):
points += max(0, scores[i] - (c * curr_time))
if i - 1 >= 0:
curr_time += times[i - 1]
else:
break
return points
# print(limak(scores, times))
# print(radewoosh(scores, times))
if limak(scores, times) > radewoosh(scores, times):
print("Limak")
elif limak(scores, times) < radewoosh(scores, times):
print("Radewoosh")
else:
print("Tie")