#include <bits/stdc++.h>
using namespace std;
int series_sum(int k) {
  int r = k % 2 == 0 ? k / 2 : -(k + 1) / 2;
  return r;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int l, r;
    cin >> l >> r;
    int x = (series_sum(r) - series_sum(l - 1));
    cout << x << endl;
  }
  return 0;
}
