#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <iomanip>
#include <math.h>
#include <limits.h>
#include <string>
#include <bitset>

using namespace std;

#define pb push_back
#define mp make_pair
#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define manytests int TT;cin >> TT; while (TT--)

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define FORd(i,a,b) for (int i = (a); i >= (b); --i)

int dx[8] = {-1, 1, 0, 0, 1, 1, -1, -1}, dy[8] = {0, 0, 1, -1, 1, 1, -1, -1};

#define ll long long
#define ld long double
#define fi first
#define se second
#define rev reverse

#define vi vector<int>
#define vl vector<ll>
#define vc vector<char>
#define vd vector<double>
#define vs vector<string>
#define vld vector<ld>
#define vb vector<bool>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpi vector<pii>

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int x, y;
    cin >> x >> y;
    if (x > y) swap(x, y);
    if (x+3>y) cout << "Yes\n";
    else cout << "No\n";

    return 0;
}
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

#define MULTI 1

void pre()
{
}

#define SQR(x) ((x)*(x))
void solve()
{
	ll l, r; cin >> l >> r;
	if (r >= 2 * l) {
		ll x = r - 2 * l + 1;
		ll ans;
		if (x % 2 == 1) ans = SQR((x + 1) / 2);
		else ans = x / 2 * (x / 2 + 1);
		cout << 2 * ans - (r / 2 - l + 1) << endl;
	} else cout << 0 << endl;
}

int main()
{
	pre();
#ifdef MULTI
	int T;
	cin >> T;
	for (int t = 0; t < T; ++t) {
#endif
		solve();
#ifdef MULTI
	}
#endif
	return 0;
}
