#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n;
cin >> n;
for(int i = 0;i < n;i ++)
{
int x, y;
cin >> x >> y;
if( x > y) swap( x, y);//注意x,y的大小
if(x % 2 == 0) x = x + 1;
else x = x + 2;
int sum = 0;
for(int i = x;i < y;i += 2) sum += i;
cout << sum << endl;
}
return 0;
}