#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int l, r;
    cin >> l >> r;
    long long int end = (r / 2) * 2;
    long long int start = ((l + 1) / 2) * 2;
    long long int ans = 0;
    long long int temp = end / 2;
    ans = ans + temp * (temp + 1);
    temp = start / 2;
    ans = ans - temp * (temp - 1);
    if (r % 2)
      end = r;
    else
      end = r - 1;
    if (l % 2)
      start = l;
    else
      start = l + 1;
    start -= 2;
    temp = (end + 1) / 2;
    ans = ans - temp * temp;
    temp = (start + 1) / 2;
    if (start >= 0) ans = ans + temp * temp;
    cout << ans << endl;
  }
}
