#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n,a,b;
cin>>n;
while(n--!=0){
cin>>a>>b;
int nums=0;
if(a>b) swap(a,b);
for(int i=a+1;i<b;i++){
if(i%2!=0) nums=nums+i;
}
cout<<nums<<endl;
}
return 0;
}