#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c = 0, d = 0, s, l, r, i, m = 0, n, j, k, ar[100005];
  long long int odd, even, sum = 0, odd1, even1, m1, n1;
  cin >> r;
  for (i = 1; i <= r; i++) {
    cin >> a >> b;
    m = b / 2;
    n = b / 2;
    if (b % 2 == 1) {
      n += 1;
    }
    even = m * (m + 1);
    odd = n * n;
    a -= 1;
    m1 = a / 2;
    n1 = a / 2;
    if (a % 2 == 1) {
      n1 += 1;
    }
    even1 = m1 * (m1 + 1);
    odd1 = n1 * n1;
    sum = (even - even1) - (odd - odd1);
    cout << sum << endl;
  }
  return 0;
}
