Skip to content
C

Double Until Limit

Mediumjava

Start from a value and repeatedly do x *= 2 until x is greater than or equal to a limit. Print how many doublings were needed and the final value.

Input: two integers start and limit separated by whitespace (start >= 1).

Output: one line: <number of doublings> <final value>. If start is already >= limit, the answer is 0 <start>.

Input (stdin)

Output

Run your code to see output here...