#include <bits/stdc++.h>
long long int mod = 1e9 + 7;
using namespace std;
int solve() {
  double a, b;
  cin >> a >> b;
  cout << (int)ceil(abs(a - b) / 10) << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  cout.setf(ios::fixed);
  int ttt = 1;
  cin >> ttt;
  while (ttt--) {
    solve();
  }
  return 0;
}
