#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int sumr = 0, suml = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    l = l - 1;
    if (r % 2 == 0)
      sumr = r / 2;
    else
      sumr = -(r + 1) / 2;
    if (l % 2 == 0)
      suml = l / 2;
    else
      suml = -(l + 1) / 2;
    sum = sumr - suml;
    cout << sum << endl;
  }
  return 0;
}
