Codeforces Round 471 (Div. 2)
翻译中…
You're given $*Q*$ queries of the form $(*L*, *R*)$.
翻译中…
For each query you have to find the number of such $*x*$ that $*L* ≤ *x* ≤ *R*$ and there exist integer numbers $*a* > 0$, $*p* > 1$ such that $*x* = *a*^{*p*}$.
翻译中…
Input
翻译中…
The first line contains the number of queries $*Q*$ $(1 ≤ *Q* ≤ 10^{5})$.
翻译中…
The next $*Q*$ lines contains two integers $*L*$, $*R*$ each $(1 ≤ *L* ≤ *R* ≤ 10^{18})$.
翻译中…
Output
翻译中…
Output $*Q*$ lines — the answers to the queries.
翻译中…
Note
翻译中…
In query one the suitable numbers are $1$ and $4$.
翻译中…
样例
Input #1
6
1 4
9 9
5 7
12 29
137 591
1 1000000
Output #1
2
1
0
3
17
1111
InputCopy
OutputCopy
题目信息
标签
二分
数学
数论
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。