#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9;
int dx[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};
long long n, l, r, ans, odd, even;
bool ok;
int main() {
  cin >> n;
  while (n--) {
    cin >> l >> r;
    l--;
    odd = (((r + 1) / 2) * ((r + 1) / 2)) - (((l + 1) / 2) * ((l + 1) / 2));
    even = ((((r / 2) * ((r / 2) + 1))) - (((l / 2) * ((l / 2) + 1))));
    cout << even - odd << "\n";
  }
  return 0;
}
