https://www.acmicpc.net/problem/1011 코드1 123456789for c in range(int(input())) : x,y=map(int,input().split()) X=y-x;i=2;s=X if X0:s-=i;S.append(s);i+=2;I.append(i) print(I[len(I)-2]-1 if S[len(S)-2]X**2+X else 2*X)cs 코드설명 y-x X X**2 + X output 1 0 0 1 2 1 2 2 3 1 2 3 4 1 2 3 5 2 6 4 6 2 6 4 7 2 6 5 8 2 6 5 9 2 6 5 10 3 12 6 11 3 12 6 12 3 12 6 13 3 12 7 14 3 12 7 15 3 12 7 16 3 12 7 17 4 20 8 18..