#P9863. [POI 2021/2022 R2] arm
[POI 2021/2022 R2] arm
Background
Translated from POI2021-2022R2 Day0 Warm-up Problem.
Problem Description
Initially, you have item. You need to increase the number of items to by performing the following step multiple times.
- Option : Store the current number of items into the database, costing time.
- Option : Increase the number of items by an amount equal to the number stored in the database, costing time.
Initially, the database is empty. Find the minimum number of operations.
Input Format
Input one line with three integers $n,a,b\ (1 \leq n \leq 10^{18},1 \leq a,b \leq 10^9)$.
Output Format
Output the minimum number of operations.
8 2 1
8
Hint
Explanation of the sample:
Initially, you have one item.
First, perform one scan, costing time.
Then print times, costing time, and the number increases to .
Continue with another scan, costing time.
Finally, print more times, costing time, and the number becomes .
Subtask distribution:
| Subtask ID | Special Property | Points |
|---|---|---|
| No special constraints |
Subtask is the sample.
Translated by ChatGPT 5