#P2618. 数字工程
数字工程
Description
The ACM Laboratory has launched a number engineering project, aiming to transform a positive integer into using some special methods.
Available methods are:
- Subtract .
- Divide by any one of its prime factors.
Each operation consumes one unit of energy.
What is the minimum energy required to turn into ?
Input Format
This problem contains multiple test cases.
For each test case, there is one line with an integer .
Output Format
Output one line with a single integer, the minimum energy consumed.
1
4
0
2
Hint
Constraints: .
Translated by ChatGPT 5
京公网安备 11011102002149号