#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
int main() {
  long long q;
  scanf("%lld", &q);
  while (q--) {
    long long l, r;
    scanf("%lld %lld", &l, &r);
    l--;
    if (l % 2 == 0)
      l /= 2;
    else
      l = -(l + 1) / 2;
    if (r % 2 == 0)
      r /= 2;
    else
      r = -(r + 1) / 2;
    printf("%lld\n", r - l);
  }
  return 0;
}
