| Contests - ACM Student Chapter - PSUT |
|---|
| Private |
| Spectator |
| PSUT Programming Contest 2026 |
|---|
| Finished |
Shoree is Moon's friend, she loves math, especially phi $$$\varphi$$$, the euler totient function, Shoree decided to make her own function called the Shoree function, defined as
Given $$$l$$$ and $$$r$$$, find
The first line contains an integer $$$t$$$ $$$(1 \le t \le 10^4)$$$ — denotes the number of test cases.
The first line and only of each test case contain two integers $$$l, r$$$ $$$(1 \le l \le r \le 10^9)$$$ — denotes the number of queries and the left boundary and the right boundary of the sum of the function respectively.
for each test case, print $$$\operatorname{MEX}$$$($$$shoree(l), shoree(l+1), ..., shoree(r)$$$)
32 31 11 7
012
$$$\varphi(x)$$$ is defined as Euler's totient function counts the positive integers up to a given integer $$$n$$$ that are relatively prime to $$$n$$$,
Note that $$$\varphi(1)$$$ $$$=$$$ $$$1$$$
For example $$$\varphi(9) = 6$$$ because the six numbers $$$1$$$, $$$2$$$, $$$4$$$, $$$5$$$, $$$7$$$ and $$$8$$$ are all the numbers that are from $$$1$$$ to $$$9$$$ and are relatively prime to $$$9$$$
The $$$\operatorname{MEX}$$$ (Minimum EXcluded value) of an array is the smallest non-negative integer that is not in the array. For example:
| Name |
|---|

