30 January 2018

UVA 10170 - The Hotel with Infinite Rooms Python Solution

from sys import stdin
scan = lambda : stdin.readline()

while True:
    n,k = map(int, scan().split())
    k = k
    sum = 0
    while True:
        sum += n
        if(sum >= k):
            print(n)
            break
        n += 1
   
   

No comments:

Post a Comment

UVA 10679 - I Love Strings!!