#include <bits/stdc++.h>
using namespace std;
void run() {
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--;
    if (l % 2 != 0) {
      l++;
      l *= -1;
    }
    if (r % 2 != 0) {
      r++;
      r *= -1;
    }
    int a = l / 2, b = r / 2;
    cout << b - a << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  run();
  return 0;
}
