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