You are given two integers $a$ and $b$. You can perform a sequence of operations: during the first operation you choose one of these numbers and increase it by $1$; during the second operation you choose one of these numbers and increase it by $2$, and so on. You choose the number of these operations yourself.

For example, if $a = 1$ and $b = 3$, you can perform the following sequence of three operations:   add $1$ to $a$, then $a = 2$ and $b = 3$;  add $2$ to $b$, then $a = 2$ and $b = 5$;  add $3$ to $a$, then $a = 5$ and $b = 5$. 

Calculate the minimum number of operations required to make $a$ and $b$ equal. 


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 100$) — the number of test cases.

The only line of each test case contains two integers $a$ and $b$ ($1 \le a, b \le 10^9$).


-----Output-----

For each test case print one integer — the minimum numbers of operations required to make $a$ and $b$ equal. 


-----Example-----
Input
3
1 3
11 11
30 20

Output
3
0
4



-----Note-----

First test case considered in the statement.

In the second test case integers $a$ and $b$ are already equal, so you don't need to perform any operations.

In the third test case you have to apply the first, the second, the third and the fourth operation to $b$ ($b$ turns into $20 + 1 + 2 + 3 + 4 = 30$).

Difficulty: interview

Starter code:

Solutions:
for _ in range(int(input())):
    a, b = list(map(int, input().split()))
    d = abs(a - b)
    ans = 0
    while d > 0 or (-d) % 2 or (-d) // 2 > ans:
        ans += 1
        d = abs(d) - ans
    print(ans)


for tcase in range(int(input())):
    a,b = list(map(int, input().split()))
    if a == b:
        print(0)
    else:
        delta = abs(b-a)
        i = 1
        sm = 0
        while sm < delta:
            sm += i
            i += 1
        while (sm%2) != (delta%2):
            sm += i
            i += 1
        print(i-1)
    


# Contest: Educational Codeforces Round 78 (Rated for Div. 2) (https://codeforces.com/contest/1278)
# Problem: B: A and B (https://codeforces.com/contest/1278/problem/B)

def rint():
    return int(input())


def rints():
    return list(map(int, input().split()))


t = rint()
for _ in range(t):
    a, b = sorted(rints())
    mn = b - a if a % 2 == b % 2 else b - a + 2
    for i in range(10**6):
        s = i * (i + 1) // 2
        if s >= b - a and (s - (b - a)) % 2 == 0:
            print(i)
            break


def f(n):
    k=((1+8*n)**0.5-1)/2
    if int(k)==k:k=int(k)
    else:k=int(k)+1
    if n%2:
        if k%4 in [1,2]:return k
        else:
            while k%4 not in [1,2]:k+=1
            return k
    else:
        if k%4 not in [1,2]:return k
        else:return (k//4)*4+3

for i in ' '*int(input()):
    a,b=map(int,input().split())
    print(f(abs(a-b)))

from math import *
for _ in range(int(input())):
	a,b=map(int,input().split())
	if a>b:
		a,b=b,a
	x=ceil((-1+(1+8*(b-a))**0.5)/2)
	if a%2==b%2:
		while x%4 not in [0,3]:
			x+=1
	else:
		while x%4 not in [1,2]:
			x+=1
	print(x)

import sys

# inf = float("inf")
# sys.setrecursionlimit(10000000)

# mod, MOD = 1000000007, 998244353

# abc='abcdefghijklmnopqrstuvwxyz'
# abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
# words = {1:'one',2:'two',3:'three',4:'four',5:'five',6:'six',7:'seven',8:'eight',9:'nine',10:'ten',11:'eleven',12:'twelve',13:'thirteen',14:'fourteen',15:'quarter',16:'sixteen',17:'seventeen',18:'eighteen',19:'nineteen',20:'twenty',21:'twenty one',22:'twenty two',23:'twenty three',24:'twenty four',25:'twenty five',26:'twenty six',27:'twenty seven',28:'twenty eight',29:'twenty nine',30:'half'}
# vow=['a','e','i','o','u']
# dx,dy=[0,1,0,-1],[1,0,-1,0]

# import random
# from collections import deque, Counter, OrderedDict,defaultdict
# from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
# from math import ceil,floor,log,sqrt,factorial,pi,gcd,degrees,atan2
# from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right

def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return list(map(int, sys.stdin.readline().strip().split()))
def input(): return sys.stdin.readline().strip()

# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

def compute(start,end):
    if start==end:
        return 0
    t = abs(end)
    step = 0
    curr = start
    while True:
        curr += (step + 1)
        if curr >= t:
            if (curr - t) % 2 == 0:
                return step + 1
        step += 1


T = int(input())
while T:
    x,y = get_ints()
    start = min(x,y)
    end = max(x,y)
    ans = compute(start, end)
    print(ans)
    T-=1


#никита съел деда

t = int(input())
for query in range(t):
    a, b = list(map(int, input().split()))
    c = abs(a - b)
    left = -1
    right = 10 ** 9
    while right - left > 1:
        mid = (left + right) // 2
        if mid * (mid + 1) // 2 >= c:
            right = mid
        else:
            left = mid
    while right * (right + 1) // 2 % 2 != c % 2:
        right += 1
    print(right)


from random import *
n = int(input())
for _ in range(n):
    a, b = map(int, input().split())
    # a = randint(1, 10)
    # b = randint(1, 10)
    c = abs(a - b)
    s = 0
    i = 1
    while s < c or (s + c) % 2 != 0:
        s += i
        i += 1
    print (i - 1)

t = int(input())
for _ in range(t):
    a, b = list(map(int, input().split()))
    for i in range(4*10**5):
        if (i*(i+1)//2 + a + b) % 2 == 0:
            if (i*(i+1))//2 >= abs(a-b):
                print(i)
                break


import sys
readline = sys.stdin.readline

def calc(x):
    if x == 0:
        return 0
    ng = 0
    ok = 10**5
    while abs(ok - ng) > 1:
        med = (ok+ng)//2
        S = med*(med+1)//2
        if abs(x) <= S:
            ok = med
        else:
            ng = med
    for i in range(5):
        if (ok+i)*(ok+1+i)//2 % 2 == x%2:
            break
        
    return ok+i
T = int(readline())
Ans = [None]*T
for qu in range(T):
    a, b = map(int, readline().split())
    Ans[qu] = calc(a-b)
print('\n'.join(map(str, Ans)))

q = int(input())
for rere in range(q):
	a, b = map(int,input().split())
	d = abs(b-a)
	i = 0
	while i*(i+1)//2 < d:
		i += 1
	if  (d%2) == ((i*(i+1)//2)%2):
		print(i)
	else:
		a = ((i*(i+1)//2)%2)
		while ((i*(i+1)//2)%2) == a:
			i += 1
		print(i)

from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
#import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 +10 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase

#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

show_flg=False
show_flg=True

t=I()
for _ in range(t):
    ans=0
    a,b=LI()
    if a>b:
        a,b=b,a
    if a==b:
        print(0)
        continue
    
    nb=max(int((2*(b-a))**0.5)-3,0)
    
    for i in range(nb,nb*2+100):
        #show(a+i*(i-1)//2,b , (a+i*(i-1)//2-b)%2,i)
        if a+i*(i+1)//2>=b and (a+i*(i+1)//2-b)%2==0:
            print(i)
            
            break
    
    #print(ans)
    


t = int(input())
    
def bin_search(d, lo, hi):
    if lo+1==hi:
        return hi
    mid = (lo+hi)//2

    if mid*(mid+1)//2 >= d:
        hi = mid
    else:
        lo = mid
    return bin_search(d, lo, hi)

for _ in range(t):
    a, b = list(map(int, input().split()))
    
    d = abs(a-b)
    
    if d==0:
        print(0)
        continue
    
    count = bin_search(d, 0, 10**6)
    
    while (count*(count+1)//2)%2!=d%2:
        count += 1
    print(count)


t = int(input())

for _ in range(t):
    a, b  = list(map(int, input().split()))
    m = int((abs(b-a) * 2) ** .5)
    for i in range(10):
        q = m * (m+1) // 2
        if q >= abs(b-a) and (q - abs(b-a)) % 2 == 0:
            print(m)
            break
        m += 1


import sys
input = sys.stdin.readline

t=int(input())

NLIST=[N*(N+1)//2 for N in range(10**5)]
import bisect

for test in range(t):
    a,b=list(map(int,input().split()))

    x=abs(b-a)

    N=bisect.bisect_left(NLIST,x)

    #print(x,N)

    while x%2!=((N+1)//2)%2:
        N+=1

    print(N)

    

    

    
    


def delta(x):
	l, r = -1, 100000
	while l + 1 < r:
		mid = (l + r) >> 1
		tot = mid * (mid + 1) // 2
		if tot < x:
			l = mid
		else:
			r = mid
	if (r * (r + 1) // 2 - x) % 2 != 0:
		return r + 1 + r % 2
	else:
		return r

t = int(input())
for i in range(t):
	a, b = map(int, input().split())
	print(delta(abs(a - b)))