백준 풀이

백준 1011번 파이썬

ag2개발자 2022. 8. 31. 17:18
t=int(input())
for _ in range(t):
    x,y=map(int,input().split())
    a=y-x
    cnt=0
    m=1
    s=0
    while s<a:
        s+=m
        cnt+=1
        if cnt%2==0:
            m+=1
    print(cnt)