No.375 Dividing a Cube into N Equal Parts (1)
Problem Statement
We 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 obtain such a division?
Find the minimum value $Tmin$ and the maximum value $Tmax$ that the number of planes $T$ can take.
Note that the pieces of the cube are not moved; while the whole keeps the shape and position of the original cube,
the cuts are made with $T$ planes.
Input
$N$
$1 \lt N \lt 10^{11}$
$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 a single 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, the cube 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
No matter how the cube is cut, it is cut with 12 planes, so $Tmin = Tmax = 12$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
tails
紙ぺーぱー