Score : $300$ points
How many triples $A,B,C$ of integers between $L$ and $R$ (inclusive) satisfy $A-B=C$?
You will be given $T$ cases. Solve each of them.
Input is given from Standard Input in the following format:
$T$ $\text{case}_1$ $\vdots$ $\text{case}_T$
Each case is in the following format:
$L$ $R$
Print $T$ values; the $i$-th of them should be the answer for $\text{case}_i$.
5 2 6 0 0 1000000 1000000 12345 67890 0 1000000
6 1 0 933184801 500001500001
In the first case, we have the following six triples: