#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a, b;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    if (a == b && a % 2 == 0) {
      cout << a << endl;
    } else if (a == b && a % 2 != 0) {
      cout << a * (-1) << endl;
    } else if ((b - a + 1) % 2 == 0 && a % 2 == 0) {
      cout << (b - a + 1) * (-1) / 2 << endl;
    } else if ((b - a + 1) % 2 == 0 && a % 2 != 0) {
      cout << (b - a + 1) / 2 << endl;
    } else if ((b - a + 1) % 2 != 0 && a % 2 == 0 && b % 2 == 0) {
      cout << b - 1 * (b - a) / 2 << endl;
    } else if ((b - a + 1) % 2 != 0 && a % 2 != 0 && b % 2 != 0) {
      cout << b * (-1) + 1 * (b - a) / 2 << endl;
    }
  }
}
