https://www.acmicpc.net/problem/1011
using System;
class Program
{
static void Main() {
string s=Console.ReadLine();
int n=int.Parse(s);
for(int i=0;i<n;i++){
string[] s1=Console.ReadLine().Split(' ');
int x=int.Parse(s1[0]);
int y=int.Parse(s1[1]);
int k=1;
int count=0;
while(x<y){
x+=k;
count++;
if(x>=y) break;
y-=k;
count++;
k++;
}
Console.WriteLine(count);
}
}
}