#include <bits/stdc++.h>
using namespace std;
void solve() {
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    --l;
    r = (abs(r) + 1) / 2 * (r & 1 ? -1 : 1);
    l = (abs(l) + 1) / 2 * (l & 1 ? -1 : 1);
    cout << r - l << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
