CF1737B.Ela's Fitness and the Luxury Number
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
While working at DTL, Ela is very aware of her physical and mental health. She started to practice various sports, such as Archery, Yoga, and Football.Since she started engaging in sports activities, Ela switches to trying a new sport on days she considers being "Luxury" days. She counts the days since she started these activities, in which the day she starts is numbered as day 1 . A "Luxury" day is the day in which the number of this day is a luxurious number.
An integer x is called a luxurious number if it is divisible by ⌊x⌋ .
Here ⌊r⌋ denotes the "floor" of a real number r . In other words, it's the largest integer not greater than r .
For example: 8 , 56 , 100 are luxurious numbers, since 8 is divisible by ⌊8⌋=⌊2.8284⌋=2 , 56 is divisible ⌊56⌋=⌊7.4833⌋=7 , and 100 is divisible by ⌊100⌋=⌊10⌋=10 , respectively. On the other hand 5 , 40 are not, since 5 are not divisible by ⌊5⌋=⌊2.2361⌋=2 , and 40 are not divisible by ⌊40⌋=⌊6.3246⌋=6 .
Being a friend of Ela, you want to engage in these fitness activities with her to keep her and yourself accompanied (and have fun together, of course). Between day l and day r , you want to know how many times she changes the activities.
输入格式
Each test contains multiple test cases. The first line has the number of test cases t ( 1≤t≤10 000 ). The description of the test cases follows.
The only line of each test case contains two integers l and r ( 1≤l≤r≤1018 ) — the intervals at which you want to know how many times Ela changes her sports.
输出格式
For each test case, output an integer that denotes the answer.
输入输出样例
输入#1
5 8 19 8 20 119 121 1 100000000000000000 1234567891011 1000000000000000000
输出#1
5 6 2 948683296 2996666667
说明/提示
In the first test case, 5 luxury numbers in range [8,19] are: 8,9,12,15,16 .