Tuesday, July 3, 2018

HANGOVER - Hangover : Classical

#The solution in Python 3 is as follows:


while True:
    c=float(input())
    n=2
    if c==0:
        break
    while c>0:
        c-=1.0/n
        n+=1
    print(n-2,'card(s)')


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