#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  while (m--) {
    int a, b;
    cin >> a >> b;
    int ans = 0, buff;
    buff = abs(a - b);
    if (buff % 10 != 0) buff = buff / 10 * 10 + 10;
    cout << buff / 10 << endl;
  }
  return 0;
}
