-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDOTAA.py
More file actions
33 lines (28 loc) · 707 Bytes
/
DOTAA.py
File metadata and controls
33 lines (28 loc) · 707 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
def getIt(n,damage):
health=[]
for i in range(n):
l=int(raw_input())
if l>damage:
health.append(l)
return health
def calculate(health,damage,noOfTowers):
sum1=0
if len(health)==0:
return 'NO'
for j in health:
sum1+=j/damage
if sum1>=noOfTowers:
return "YES"
else:
return "NO"
def main():
noOfCases=int(raw_input())
for i in range(noOfCases):
line=[]
line=map(int,raw_input().split())
n=line[0]
damage=line[2]
noOfTowers=line[1]
health=getIt(n,damage)
print(calculate(health,damage,noOfTowers))
main()