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