#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q;
  cin >> q;
  for (long long i = 0; i < q; ++i) {
    long long l, r;
    cin >> l >> r;
    long long ans = 0;
    if (l % 2 == 0) {
      if (r % 2 == 0) {
        ans = -((r - l + 1) / 2);
        ans += r;
      } else {
        ans = -((r - l + 1) / 2);
      }
    } else {
      if (r % 2 == 0) {
        ans = ((r - l + 1) / 2);
      } else {
        ans = ((r - l + 1) / 2);
        ans -= r;
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
