#include <bits/stdc++.h>
using namespace std;
long long f(long long x) {
  if (x % 2 == 0) {
    return x / 2;
  } else {
    return -x + f(x - 1);
  }
}
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    long long a, b;
    cin >> a >> b;
    cout << f(b) - f(a - 1) << endl;
  }
}
