Divison by Five
CodeChefOpen on judge ↗
There is sequence 1, 12, 123, 1234, ..., 12345678910,1234567891011... upto infinity. Now you are given two integers L and R, you have to find the number of integers from Lth number to Rth (inclusive) number, which are divisible by 5. For example, let L = 3. R = 5. So, the numbers in the sequence are, 123, 1234, 12345. And only 12345 are divisible by 5. So, the result is 1. Input - Input starts
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start