#UnknownID28. XHXMMMlOPIX0Wg#"'`%
XHXMMMlOPIX0Wg#"'`%
Statement
Dora has a set containing integers. In the beginning, she will put all integers in into the set . That is, an integer is initially contained in the set if and only if . Then she allows you to perform the following operations:
- Select three distinct integers , , and from the set , such that .
- Then, remove these three integers from the set .
What is the maximum number of operations you can perform?
Recall that means the greatest common divisor of integers and .
Format
Input
Each test consists of multiple test cases. The first line contains a single integer ( ) — the number of test cases. The description of the test cases follows.
The only line of each test case contains two integers and ( ) — the range of integers in the initial set.
Output
For each test case, output a single integer — the maximum number of operations you can perform.
Sample
8
1 3
3 7
10 21
2 8
51 60
2 15
10 26
1 1000
1
1
3
1
2
3
4
250
相关
在下列比赛中: