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