#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long q, x, y, ans, ans2;
  cin >> q;
  for (int i = 0; i < q; i++) {
    ans = 0;
    ans2 = 0;
    cin >> x >> y;
    if (y % 2 == 0)
      ans = y / 2;
    else
      ans = (y - 1) / 2 + pow(-1, y) * y;
    if ((x - 1) % 2 == 0)
      ans2 = (x - 1) / 2;
    else
      ans2 = (x - 2) / 2 + pow(-1, (x - 1)) * (x - 1);
    cout << ans - ans2 << endl;
  }
  return 0;
}
