Count Divisors
Practice
3.9 (1585 votes)
Easy
Problem
88% Success 178817 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB Max Code

You have been given 3 integers - l, r and k. Find how many numbers between l and r (both inclusive) are divisible by k. You do not need to print these numbers, you just have to find their count.

Input Format
The first and only line of input contains 3 space separated integers l, r and k.

Output Format
Print the required answer on a single line.

Constraints
\( 1 \le l \le r \le 1000 \)
\( 1 \le k \le 1000\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:10
2539 votes
Tags:
Easy
Points:10
2383 votes
Tags:
Easy
Points:10
455 votes
Tags:
Basic ProgrammingEasyInput/Output