We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
ways = [1]*100001
for x in [2,5,10,20,50,100,200]:
for i in range(x,100001):
ways[i] += ways[i-x]
k = int(input())
for i in range (k):
l = int(input())
print (ways[l]%(10**9+7))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #31: Coin sums
You are viewing a single comment's thread. Return to all comments →
ways = [1]*100001 for x in [2,5,10,20,50,100,200]: for i in range(x,100001): ways[i] += ways[i-x] k = int(input()) for i in range (k): l = int(input()) print (ways[l]%(10**9+7))