#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t, l, r, sum, ans, odd_sum, l_sum, l_oddSum;
  cin >> t;
  while (t--) {
    cin >> l >> r;
    sum = (r * (r + 1)) / 2;
    odd_sum = (r % 2 == 0) ? (r * r) / 4 : ((r + 1) * (r + 1)) / 4;
    l_sum = (l * (l - 1)) / 2;
    l_oddSum = (l % 2 == 0) ? (l * l) / 4 : ((l - 1) * (l - 1)) / 4;
    odd_sum = odd_sum - l_oddSum;
    sum = sum - l_sum;
    cout << sum - (2 * odd_sum) << endl;
  }
  return 0;
}
