#include <bits/stdc++.h>
int main() {
  int q, i, j;
  scanf("%d", &q);
  long int l[q], r[q], res[q];
  for (i = 1; i <= q; i++) {
    scanf("%ld%ld", &l[i], &r[i]);
  }
  for (i = 1; i <= q; i++) {
    if ((r[i] - l[i] + 1) % 2 == 0 && l[i] % 2 == 0)
      res[i] = -(r[i] - l[i] + 1) / 2;
    else if ((r[i] - l[i] + 1) % 2 == 0 && l[i] % 2 == 1)
      res[i] = (r[i] - l[i] + 1) / 2;
    else if ((r[i] - l[i] + 1) % 2 == 1 && l[i] % 2 == 1)
      res[i] = (r[i] - l[i] + 1) / 2 - r[i];
    else if ((r[i] - l[i] + 1) % 2 == 1 && l[i] % 2 == 0)
      res[i] = -(r[i] - l[i] + 1) / 2 + r[i];
    printf("%ld\n", res[i]);
  }
}
