#include <bits/stdc++.h>
using namespace std;
void solve() {
  int q, l, r;
  cin >> q;
  while (q--) {
    cin >> l >> r;
    int leftN = l + (l % 2 == 0 ? 1 : 0);
    int rightN = r - (r % 2 == 0 ? 1 : 0);
    int leftC = l + (l % 2 == 1 ? 1 : 0);
    int rightC = r - (r % 2 == 1 ? 1 : 0);
    int N = 0;
    if (leftN <= rightN) {
      N = (rightN - leftN) / 2 + 1;
    }
    int C = 0;
    if (leftC <= rightC) {
      C = (rightC - leftC) / 2 + 1;
    }
    long long res = 0;
    if (r - l < 1000) {
      for (int i = l; i <= r; i++) {
        if (i % 2 == 0) {
          res += i;
        } else {
          res -= i;
        }
      }
      cout << res << "\n";
      continue;
    }
    if (l % 2 == 0) {
      if (r % 2 == 0) {
        cout << r - N << "\n";
      } else {
        cout << -N << "\n";
      }
    } else {
      if (r % 2 == 0) {
        cout << C << "\n";
      } else {
        cout << -r + C << "\n";
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}
