#40475: 參考答案 Python


cookie38052742@gmail.com (餅謙)


'''
https://zerojudge.tw/ShowProblem?problemid=e555
e555. 10170 - The Hotel with Infinite Rooms
'''

while True:
    try:
       
        S, D = map(int, input().split())
        while True:
            if D>0:    
                D -= S
                S += 1
            if D<=0:
                print(S - 1)
                break
       
    except:
        break
#40476: Re: 參考答案 Python


cookie38052742@gmail.com (餅謙)


乾這樣會TLE 抱歉沒測過就丟上來