Divisibility by 8
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Consider an infinite numerical sequence defined as follows: (A_1 = 1), (A_2 = 12), ..., (A_10 = 12345678910), (A_11 = 1234567891011), and so on. The first term is (1), and each subsequent term is formed by appending the decimal representation of its index to the end of the previous term's decimal representation.
Your task is to find how many terms in this sequence are divisible by (8) without a remainder, specifically among those terms whose indices fall within the range ([M, N]).
Input
The input consists of a single line containing two positive integers, (M) and (N) ((0 < M, N 10^18)).
Output
Output a single line containing the answer to the problem.
Examples
Input #1
Answer #1
Submissions 345
Acceptance rate 8%