#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int l, r;
    cin >> l >> r;
    if (l == r) {
      if (l % 2 == 0)
        cout << l << endl;
      else
        cout << -1 * l << endl;
    } else {
      long long int sum = 0, sum2 = 0;
      long long int i = l;
      long long int c = 0;
      while (i <= r) {
        i += 2;
        c++;
      }
      sum = (c * (2 * l + (c - 1) * 2)) / 2;
      long long int j = l + 1;
      long long int c1 = 0;
      while (j <= r) {
        j += 2;
        c1++;
      }
      sum2 = (c1 * (2 * (l + 1) + (c1 - 1) * 2)) / 2;
      ;
      if (l % 2 == 0)
        cout << sum - sum2 << endl;
      else
        cout << sum2 - sum << endl;
    }
  }
  return 0;
}
