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