题目描述
Let [MATH0] be the floor of the binary logarithm of $x$. In other words, [MATH3] is largest non-negative integer $y$, such that $2^y$ does not exceed $x$.
Let [MATH8] be the floor of the logarithm of $x$ with base [MATH11]. In other words, [MATH13] is the largest non-negative integer $z$, such that ${f(x)}^{z}$ does not exceed $x$.
You are given $q$ queries. The $i$-th query consists of two integers $l_i$ and $r_i$. The answer to the query is the sum of [MATH22] across all integers $k$, such that $l_i \leq k \leq r_i$. Since the answers might be large, print them modulo ${10^9 + 7}$.
Input
The first line contains a single integer $q$ — the number of queries ($1 \leq q \leq 10^5$).
The next $q$ lines each contain two integers $l_i$ and $r_i$ — the bounds of the $i$-th query ($4 \leq l_i \leq r_i \leq 10^{18}$).
Output
For each query, output the answer to the query modulo $10^9 + 7$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分