// 2021-03-14 08:00-08:
#include <bits/stdc++.h>
using namespace std;

int main(){
	int t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		long long l, r;
		cin >> l >> r;
		long long count = 0;
		if(r < 2 * l){
			cout << count << endl;
			continue;
		}
		count = ((r - l + 1) * (r - 3 * l + 2) + (l - 1) * l) / 2;
		cout << count << endl;
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define ld long double
#define MOD 1000000007
#define endl "\n"
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(var) (var).begin(), (var).end()
#define sz(x) (int)x.size()
#define MAXX 9000000000000000000
#define pii pair<int,int>
#define vi vector<int>
#define vvi vector<vector<int> >
#define vpi vector<pair<int,int> > 
#define vvpi vector<vector<pair<int,int> > >

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n,d,h;
	cout << fixed << setprecision(15);
	double ans = 0.0;
	cin >> n >> d >> h;
	for(int i=0;i<n;i++)
	{
		int x, y;
		cin >> x >> y;
		double m = (1.0 * (y - h)) / (1.0 * (x - d));
		double c = 1.0 * y - m * (1.0 * x);
		ans = max(ans, c);
	}

	cout << ans;	
	return 0;
}