407171: GYM102697 142 Hydra Tree
Description
You have a tree that is growing very fast. At first, the tree has one branch. On each successive day, the tree grows a certain number of branches. On each day, the number of new branches is calculated as $$$n$$$ times $$$b$$$, where $$$b$$$ represents how many branches were on the tree on the previous day, and $$$n$$$ is a variable you have to calculate. $$$n$$$ will always be greater than one.
At an unknown number of days, the tree has $$$x$$$ branches. Given this value, figure out the minimum possible value of $$$n$$$ used in the formula, given that the tree started out with exactly one branch.
InputThe only line of input contains a single positive integer $$$x$$$. $$$x$$$ will be less than 10000.
OutputOutput a single positive integer $$$n$$$: the minimum possible value of $$$n$$$, greater than one, such that the tree could have $$$x$$$ branches at some point. $$$n$$$ has to stay the same throughout the entire process of growing the tree, i.e. it cannot change between days.
ExamplesInput36Output
5Input
66Output
65