#include <bits/stdc++.h>
long long n, i, k, r, ll, lc, rl, rc, l, sumc, suml;
using namespace std;
int main() {
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lld%lld", &l, &r);
    if (l % 2 == 0) {
      lc = l;
      ll = l + 1;
    } else {
      lc = l + 1;
      ll = l;
    }
    if (r % 2 == 0) {
      rc = r;
      rl = r - 1;
    } else {
      rc = r - 1;
      rl = r;
    }
    sumc = (lc + rc) * ((rc - lc) / 2 + 1) / 2;
    suml = (ll + rl) * ((rl - ll) / 2 + 1) / 2;
    cout << sumc - suml << endl;
  }
  return 0;
}
