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