There is enough money available on ATM in nominal value 10, 20, 50, 100, 200 and 500 dollars.
You are given money in nominal value of `n` with `1<=n<=1500`.
Try to find minimal number of notes that must be used to repay in dollars, or output -1 if it is impossible.
Good Luck!!!
def solve(n):
    t=0
    for d in [500,200,100,50,20,10]:
        a,n=divmod(n,d)
        t+=a
    if n: return -1
    return t
def solve(n):
    t=0
    for d in [500,200,100,50,20,10]:
        a,n=divmod(n,d)
        t+=a
    if n: return -1
    return t