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