#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int l, r, ls, rs;
    cin >> l >> r;
    l--;
    if (l % 2)
      ls = (l / 2 + 1) * -1;
    else
      ls = l / 2;
    if (r % 2)
      rs = (r / 2 + 1) * -1;
    else
      rs = r / 2;
    cout << rs - ls << endl;
  }
}
