#include #include #include using namespace std; using ll = long long; ll f(ll n){ if(n==0) return 0ll; string s=to_string(n); int d=s.size(); ll cnt[d+1][10][2]={}; cnt[0][0][0]=1; for(int i=0; i> t; while(t--){ ll l, r; cin >> l >> r; cout << f(r)-f(l-1) << '\n'; } return 0; }