#P11560. 【MX-X7-T1】[LSOT-3] 分蛋糕
【MX-X7-T1】[LSOT-3] 分蛋糕
Background
Original problem link: https://oier.team/problems/X7B.
There used to be a rather bizarre background story hinting at modern marketing accounts, but it was deleted because it was too bizarre.
Problem Description
Given two positive integers and , you may choose one of the following operations each time:
- .
- .
- .
Find the minimum number of operations needed to make .
Input Format
Only one line with two positive integers .
Output Format
Only one line with one non-negative integer, representing the minimum number of operations.
1 5
3
114514 1919810
87590
Hint
Sample Explanation #1
Initially, and .
- Perform operation , resulting in , .
- Perform operation , resulting in , .
- Perform operation , resulting in , .
The total number of operations is . It can be proven that there is no solution with fewer operations.
Constraints
For of the testdata, .
For of the testdata, .
For all testdata, .
Translated by ChatGPT 5