No.376 Dividing a Cube into N Equal Parts (2)
Problem Statement
You want to cut a cube with some number of planes to divide it into $N$ congruent rectangular cuboids.
How many planes should be used to cut the cube to make such a division?
Find the minimum possible value $Tmin$ and the maximum possible value $Tmax$ of the number of planes $T$.
Note that the cube is cut by the $T$ planes with the whole keeping the shape and position of the original cube,
without moving any of the cut pieces.
* This problem differs from "立方体のN等分 (1)" only in the input constraints.
Input
$N$
$1 \lt N \lt 10^{14}$
$N$ is an integer.
The cube is divided into $N$ congruent rectangular cuboids.
Output
$Tmin$ $Tmax$
Output the minimum value $Tmin$ and the maximum value $Tmax$ of the number of planes.
Separate $Tmin$ and $Tmax$ with one space.
Print a newline at the end.
Sample
Sample 1
Input
12
Output
4 11
As shown in red in the figure below, the cube can be divided into 12 congruent rectangular cuboids by cutting with 4 planes.
It cannot be divided with fewer planes, so $Tmin = 4$.

Also, it can be divided into 12 congruent rectangular cuboids by cutting with 11 planes parallel to the base.
It cannot be divided with more planes, so $Tmax = 11$.
Sample 2
Input
13
Output
12 12
Any way of cutting uses 12 planes, so $Tmin = Tmax = 12$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
tails
紙ぺーぱー