include [HTML_REMOVED]
using namespace std;
define ll long long
int main()
{
ll n;
ll x,y;
ll a,b,c;
cin>>n;
for(a=1;a<=n;a)
{
int n=0;
cin>>x>>y;
if(x>y) swap(x,y);
for(b=x+1;b<y;b)
{
if(b%2==1|| b%2==-1) n=n+b;
}
cout<<n<<endl;
}
return 0;
}