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