#include using namespace std; typedef long long ll; int main(){ int t; cin >> t; while(t){ t--; ll l,r; cin >> l >> r; ll le = 2*l + (r + 1 - l)/8*8,ri = (l + r + 1); ll ans = 0; int j = 0; for(ll i=le;i