#include <bits/stdc++.h>
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int l, r;
    scanf("%d%d", &l, &r);
    if (l % 2) {
      if (r % 2)
        printf("%d\n", (r - l) / 2 - r);
      else
        printf("%d\n", (r - l + 1) / 2);
    } else {
      if (r % 2)
        printf("%d\n", -(r - l + 1) / 2);
      else
        printf("%d\n", r - (r - l) / 2);
    }
  }
}
