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