Products
Time limit1sMemory limit128 MB
Find the minimum count k of positive integers a1..ak such that the product of (ai+1) equals n times the product of ai.
- Level
Hard8 of 10
- Topics
- Number theory, Math, Backtracking, Brute force
- Solved
- No attempts yet
Problem
Let be a positive integer. George wrote a program that finds positive integers whose product increases exactly times when we add 1 to each of them; that is,
Now he wants to find the smallest value of for which this is possible. Write a program mink that solves George's new task.
Input
The first line of standard input contains the integer ().
Output
Write the required value of on a single line of standard output.