#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, m, a, b, c, d, sum = 0, num = 0, mx = 0, mn = 0, mnn = 0,
                                 mxx = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (b % 2 == 0)
      c = b / 2;
    else
      c = -(ceil(b / 2.0));
    if (a % 2 == 1)
      d = a / 2;
    else
      d = -(a / 2);
    cout << c - d << endl;
  }
}
