#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  for (int i = 0; i < a; i++) {
    int b, c;
    cin >> b >> c;
    int d = abs(b - c);
    cout << (d + 9) / 10 << "\n";
  }
}
