#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q;
  cin >> q;
  long long a[q], b[q];
  for (long long i = 0; i < q; i++) {
    cin >> a[i] >> b[i];
    if (a[i] % 2 == 0) {
      if (b[i] % 2 == 0)
        cout << (-1) * ((b[i] - a[i] + 1) / 2) + b[i] << endl;
      else
        cout << (-1) * ((b[i] - a[i] + 1) / 2) << endl;
    } else {
      if (b[i] % 2 == 0)
        cout << ((b[i] - a[i] + 1) / 2) << endl;
      else
        cout << (b[i] - a[i] + 1) / 2 - b[i] << endl;
    }
  }
}
