Thursday, June 21, 2018

DOTAA - DOTA HEROES : Classical

#The solution in Python 3 is as follows:

for _ in range(int(input())):
    n, m, D = map(int, input().split())
    c = sum((int(input())-1)//D for _ in range(n))
    print('YES') if c >= m else print('NO')


#Keep visiting for more solutions of SPOJ problems in Python 3.Thank you!!!