GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Friday 7 October 2022

[Solution] Ela's Fitness and the Luxury Number Codeforces Solution



B. Ela's Fitness and the Luxury Number
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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: 856100 are luxurious numbers, since 8 is divisible by 8=2.8284=256 is divisible 56=7.4833=7, and 100 is divisible by 100=10=10, respectively. On the other hand 540 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.

Input

Each test contains multiple test cases. The first line has the number of test cases t (1t10 000). The description of the test cases follows.

Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

The only line of each test case contains two integers l and r (1lr1018) — the intervals at which you want to know how many times Ela changes her sports.

Output

For each test case, output an integer that denotes the answer.

No comments:

Post a Comment