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