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