#include <bits/stdc++.h>
using namespace std;
int sum(int x) { return ((x & 1) ? -1 : 1) * (x + 1) / 2; }
int main() {
  int q;
  cin >> q;
  while (q--) {
    int a, b;
    cin >> a >> b;
    cout << sum(b) - sum(a - 1) << endl;
  }
  return 0;
}
