[Solution] Split N CodeChef Solution 2022
Problem
Kulyash is given an integer . His task is to break into some number of (integer) powers of .
TO achieve this, he can perform the following operation several times (possibly, zero):
- Choose an integer which he already has, and break into integer parts ( and ) such that .
Find the minimum number of operations required by Kulyash to accomplish his task.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
👇👇👇👇👇
- Each test case consists of a single line of input.
- The first and only line of each test case contains an integer — the original integer with Kulyash.
Output Format
For each test case, output on a new line the minimum number of operations required by Kulyash to break into powers of .
Explanation:
Test case : can be broken into and (both are powers of ) by using operation.
Test case : is already a power of so there is no need to perform any operations.
No comments:
Post a Comment