#include <bits/stdc++.h>
using namespace std;
const long double PI = 4 * atan(1);
void solve() {
  long long int l, r;
  cin >> l >> r;
  long long int s1, s2;
  l--;
  if (l % 2 == 1)
    s1 = (-1) * (l + 1) / 2;
  else
    s1 = l / 2;
  if (r % 2 == 1)
    s2 = (-1) * (r + 1) / 2;
  else
    s2 = r / 2;
  cout << s2 - s1 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
