#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int x,y;
for (int i = 1; i<=n;i++)
{
cin >> x >> y;
if (x > y)
{
int t;
t = x;
x = y;
y = t;
}
int sum =0;
for (int j = x + 1;j < y; j ++)
{
if (j % 2 != 0 ) sum += j;
}
cout << sum << endl;
sum = 0;
}
return 0;
}