About the Sprite
The 8th grade class plans to bring a large amount of Sprite to their gathering. To achieve this, they have decided to build a portable cooler with dimensions a
×b
×c
that will precisely accommodate n
cubic cans of Sprite, each measuring 1×1×1. To keep the Sprite as cold as possible, they aim to minimize heat loss by reducing the surface area of the cooler.
For instance, if the cooler needs to have a capacity of 12, the following configurations are possible:
3×2×2 → Surface area: 32
4×3×1 → Surface area: 38
6×2×1 → Surface area: 40
12×1×1 → Surface area: 50
In this example, the optimal cooler configuration is 3×2×2.
Your task is to help the 8th grade class find the optimal cooler configuration for any given capacity.
Input
A single integer n
(1 ≤ n ≤ 10^6
), representing the number of cubic cans.
Output
Three integers a
, b
, c
(1 ≤ a, b, c ≤ 10^6
) representing the dimensions of the optimal cooler. The dimensions should be presented in non-decreasing order.