The Answer to the Ultimate Question of Life, the Universe, and Everything
Time limit0.42sMemory limit420 MB
Given n, k, and the leading digit x of 2^n, count the powers of 2 up to 2^n whose leading digit is 4.
- Level
Hard9 of 10
- Topics
- Math, Number theory
- Solved
- No attempts yet
Problem
has digits in decimal notation, and its leading digit is .
Given positive integers , , and , count the powers of 2 among the integers from to that start with the digit 4.
Input
The first line contains the positive integers , , and . (; ; )
Only cases where are given.
Output
Print the number of powers of 2 among the integers from to that start with the digit 4.