#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int Mod=998244353;

void solve() {
    int l,r;
    cin >> l >> r;
    int ans = 0 ;
    for(int i=l;i<=r;i++) if(i%2==1) ans++;
    cout << ans/2 << '\n';
}

int main(){ 
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
	
    int t;
    cin >> t;
    while (t--) solve();
    

    return 0;
}
