問題一覧 > 通常問題

No.376 Dividing a Cube into N Equal Parts (2)

レベル : / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 117
作問者 : 👑 tails / テスター : 紙ぺーぱー
お気に入りにしたユーザー ProblemId : 547 / 自分の提出
問題文最終更新日: 2026-06-25 04:46:39
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 138 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。