#include <bits/stdc++.h>
using namespace std;
long calc(long l, long r) {
  long le = l & 1 ? l + 1 : l;
  long re = r & 1 ? r - 1 : r;
  long lo = l & 1 ? l : l + 1;
  long ro = r & 1 ? r : r - 1;
  le /= 2;
  re /= 2;
  lo = (lo + 1) / 2;
  ro = (ro + 1) / 2;
  long te = re * (re + 1);
  long t2e = le * (le + 1);
  long evens = (te - t2e) + (le * 2);
  long to = (ro * ro);
  long t2o = (lo * lo);
  long odds = (to - t2o) + (lo * 2 - 1);
  return evens - odds;
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  string ans = "";
  while (n--) {
    long l, r;
    cin >> l >> r;
    long sum = calc(l, r);
    ans += to_string(sum) + "\n";
  }
  cout << ans;
  return 0;
}
