#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, a, b, answer;
  cin >> t;
  for (; t > 0; --t) {
    cin >> a >> b;
    answer = abs(a - b);
    if (answer % 10) answer += 10;
    cout << answer / 10 << '\n';
  }
  return 0;
}
