Degrees of two
Easy
Execution time limit is 1 second
Runtime memory usage limit is 122.486 megabytes
It's not a secret that the number 2^n
for any nonnegative integer n in binary notation has a very simple form - one in the high bit and then follow n zeros. In the decimal system these numbers are not so unvaried, but even among them there are those that start with one.
Calculate how many such numbers in a given range.
Input
Two integers n[1]
and n[2]
(0 ≤ n[1]
< n[2]
≤ 10^9
), separated with a space.
Output
Print, how many numbers are power of two, belong to the range [2^n1
; 2^n2
] and in decimal notation their first digit is one.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 17%