This problem is as simple as short. Just find how many numbers from A to B with sum of digits from X to Y are divisible by K.
Input
The first line contains 5 space-separated positive integers: A, B, X, Y, K
Output
Output one number - answer for the question.
Constraints
0 < A, B, K ≤ 1013
0 < X, Y ≤ 1000
A ≤ B
0 < A, B, ≤ 107 in 32 % of the test data
Sample Input(Plaintext Link)
5 86 1 6 4
Sample Output(Plaintext Link)
6

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

Explanation
There are 6 such numbers: 12, 20, 24, 32, 40, 60

@Lyrae

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.