#include <bits/stdc++.h>
using namespace std;
long long f(long long n) {
  if (n % 2 == 0)
    return n / 2;
  else
    return -n + f(n - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long i = 0, l, r, q, s = 0;
  cin >> q;
  while (q > 0) {
    cin >> l >> r;
    cout << f(r) - f(l - 1) << "\n";
    q--;
    s = 0;
  }
  return 0;
}
