#P10416. [蓝桥杯 2023 国 A] XYZ
[蓝桥杯 2023 国 A] XYZ
Problem Description
Given an interval , find how many triples satisfy and .
Input Format
This problem contains multiple queries.
The first line contains an integer , the number of queries.
The next lines each contain two integers , separated by a space, representing one query.
Output Format
Output lines. Each line contains one integer, the number of triples that satisfy the conditions.
2
1 3
1 4
3
6
Hint
[Sample Explanation 1]
[Test Case Scale and Conventions]
For of the testdata, and .
For all testdata, and .
Translated by ChatGPT 5