#include <bits/stdc++.h>
int S(int x) { return x & 1 ? -(x + 1) / 2 : x / 2; }
int main() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    printf("%d\n", S(r) - S(l - 1));
  }
  return 0;
}
