#include <bits/stdc++.h>
const long long kot = LLONG_MAX;
using kk = long double;
const long long int alpha = 1e18;
using namespace std;
int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
int largest(long long int arr[], long long int n) {
  return *max_element(arr, arr + n);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
void sieve(bool primes[], int x) {
  primes[1] = false;
  for (int i = 2; i * i <= x; i++) {
    if (primes[i] == true) {
      for (int j = 2; j * i <= x; j++) primes[i * j] = false;
    }
  }
}
long long int power(long long int x, unsigned long long int y,
                    long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
class gfg {
 public:
  int sumDigits(int no) { return no == 0 ? 0 : no % 10 + sumDigits(no / 10); }
};
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
bool comp(int a, int b) { return (a < b); }
vector<long long int> ve;
void divisors(long long int n) {
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        ve.emplace_back(i);
      else
        ve.emplace_back(i);
      ve.emplace_back(n / i);
    }
  }
}
bool isPrime(long long int n) {
  if (n == 1) {
    return false;
  }
  long long int i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    i += 1;
  }
  return true;
}
int gcdofarray(long long int v[], long long int n) {
  long long int result = v[0];
  for (long long int i = 1; i < n; i++) result = gcd(v[i], result);
  return result;
}
int sumofdigits(long long int n) {
  long long int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
bool powertwo(long long int x) { return x && (!(x & (x - 1))); }
long long int finduncommonsubsequence(string str, string s) {
  if (!str.compare(s)) {
    return 0;
  }
  return max(str.length(), s.length());
}
void reversec(string str) {
  for (long long int i = str.length() - 1; i >= 0; i--) cout << str[i];
}
void solve() {
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int a, b;
    cin >> a >> b;
    long long int d;
    if (a > b) {
      d = a - b;
    } else {
      d = b - a;
    }
    long long int i;
    for (i = 0; i * (i + 1) / 2 < d || (i * (i + 1) / 2 + d) % 2 == 1; i++)
      ;
    cout << i << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

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: 

  1. add 1 to a, then a = 2 and b = 3; 
  2. add 2 to b, then a = 2 and b = 5; 
  3. 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 ≤ t ≤ 100) — the number of test cases.

The only line of each test case contains two integers a and b (1 ≤ a, b ≤ 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).

### Response

```cpp
#include <bits/stdc++.h>
const long long kot = LLONG_MAX;
using kk = long double;
const long long int alpha = 1e18;
using namespace std;
int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
int largest(long long int arr[], long long int n) {
  return *max_element(arr, arr + n);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
void sieve(bool primes[], int x) {
  primes[1] = false;
  for (int i = 2; i * i <= x; i++) {
    if (primes[i] == true) {
      for (int j = 2; j * i <= x; j++) primes[i * j] = false;
    }
  }
}
long long int power(long long int x, unsigned long long int y,
                    long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
class gfg {
 public:
  int sumDigits(int no) { return no == 0 ? 0 : no % 10 + sumDigits(no / 10); }
};
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
bool comp(int a, int b) { return (a < b); }
vector<long long int> ve;
void divisors(long long int n) {
  for (int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        ve.emplace_back(i);
      else
        ve.emplace_back(i);
      ve.emplace_back(n / i);
    }
  }
}
bool isPrime(long long int n) {
  if (n == 1) {
    return false;
  }
  long long int i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    i += 1;
  }
  return true;
}
int gcdofarray(long long int v[], long long int n) {
  long long int result = v[0];
  for (long long int i = 1; i < n; i++) result = gcd(v[i], result);
  return result;
}
int sumofdigits(long long int n) {
  long long int sum = 0;
  while (n > 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
bool powertwo(long long int x) { return x && (!(x & (x - 1))); }
long long int finduncommonsubsequence(string str, string s) {
  if (!str.compare(s)) {
    return 0;
  }
  return max(str.length(), s.length());
}
void reversec(string str) {
  for (long long int i = str.length() - 1; i >= 0; i--) cout << str[i];
}
void solve() {
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int a, b;
    cin >> a >> b;
    long long int d;
    if (a > b) {
      d = a - b;
    } else {
      d = b - a;
    }
    long long int i;
    for (i = 0; i * (i + 1) / 2 < d || (i * (i + 1) / 2 + d) % 2 == 1; i++)
      ;
    cout << i << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  solve();
}

```