#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > g;
long long sm(long long n) {
  if (n % 2 == 0) return n / 2;
  return sm(n - 1) - n;
}
void solve() {
  long long l, r;
  cin >> l >> r;
  cout << sm(r) - sm(l - 1) << endl;
}
int32_t main() {
  long long n = 1;
  cin >> n;
  for (long long i = 0; i < n; i++) solve();
  return 0;
}
