#CCBCHMOT0000056. Điểm dừng nhân đôi (Minimum Doublings to Reach a Threshold)
Điểm dừng nhân đôi (Minimum Doublings to Reach a Threshold)
Minimum Doublings to Reach a Threshold
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers with , start from . Each operation doubles the current value. Find the minimum number of operations needed to reach or exceed . If the starting value already meets the threshold, the answer is zero.
Input
One line contains two integers and , in this order.
Output
Print one nonnegative integer: the minimum number of doublings.
Subtasks
- Subtask 1 (20%): .
- Subtask 2 (30%): .
- Subtask 3 (50%): .
Examples
Example 1
Input
3 20
Output
3
Explanation
The values are 3, 6, 12, 24. Two operations are insufficient, while three reach the threshold.
Example 2
Input
100 100
Output
0
Explanation
The starting value already equals the threshold, so no operation is needed.