[Solution] Ela's Fitness and the Luxury Number Codeforces Solution
. A "Luxury" day is the day in which the number of this day is a luxurious number.
An integer is called a luxurious number if it is divisible by .
Here denotes the "floor" of a real number . In other words, it's the largest integer not greater than .
For example: , , are luxurious numbers, since is divisible by , is divisible , and is divisible by , respectively. On the other hand , are not, since are not divisible by , and are not divisible by .
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 and day , 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 (). The description of the test cases follows.
The only line of each test case contains two integers and () — 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.
No comments:
Post a Comment