#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x, y;
    cin >> x >> y;
    long long l = x - y;
    l = l < 0 ? -l : l;
    int r = l % 10;
    long long a = l / 10.0;
    if (r) a++;
    cout << a;
    cout << "\n";
  }
}
