#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int N, s, x, y;
cin >> N;
while (N -- ) {
s = 0;
cin >> x >> y;
if (x > y) swap(x, y);
for (++ x; x < y; x ++ ) {
if (x % 2) s += x;
}
cout << s << endl;
}
return 0;
}