https://www.acmicpc.net/problem/1011
#include<stdio.h>
#include<math.h>
int main() {
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
int x,y;
scanf("%d %d",&x,&y);
int k=1;
int count=0;
while(x<y){
x+=k;
count++;
if(x>=y) break;
y-=k;
count++;
k++;
}
printf("%d\n",count);
}
}