#include <bits/stdc++.h>
using namespace std;
int a[500005];
int main() {
  long long int n, i, j, qe, l, k, m, r, res, pos, x, y;
  long long int er, orr, el, ol, osum, esum, rn, rp, ln, lp;
  cin >> qe;
  while (qe--) {
    cin >> l >> r;
    if (r % 2 == 0) {
      er = r / 2;
      orr = er;
    } else {
      er = r / 2;
      orr = er + 1;
    }
    rp = er * (er + 1);
    rn = orr * orr;
    l--;
    lp = 0;
    ln = 0;
    if (l > 0) {
      if (l % 2 == 0) {
        el = l / 2;
        ol = el;
      } else {
        el = l / 2;
        ol = el + 1;
      }
      ln = ol * ol;
      lp = el * (el + 1);
    }
    long long int tn = ln - rn;
    long long int tp = rp - lp;
    res = tn + tp;
    cout << res << '\n';
  }
  return 0;
}
