Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM_0160 - BEER REFRIGERATOR |
Beer Lovers Club makes regular parties. They hate warm beer, but club’s refrigerator is too small to store enough beer for the whole company. So they decided to order a special super-big beer refrigerator. The new refrigerator should be a parallelepiped a × b × c and store exactly n cubical 1 × 1 × 1 beer boxes (the club has n members). To decrease losses of cold, the total area of the surface of the refrigerator must be as small as possible.
For example, if the capacity of the refrigerator must be 12, the possible variants are:
Dimensions |
Surface Area |
3 x 2 x 2 |
32 |
4 x 3 x 1 |
38 |
6 x 2 x 1 |
40 |
12 x 1 x 1 |
50 |
The best variant in this case is 3 x 2 x 2.
Help the beer lovers to find the optimal dimensions for their new refrigerator.
Input
The input file contains single integer number n (1 ≤ n ≤ 106) — the capacity of the refrigerator.
Output
Output three integer numbers: a, b and c — the optimal dimensions of the refrigerator.
Examples
№ |
stdin |
stdout |
1 |
12 |
2 2 3 |
2 |
13 |
1 1 13 |
1 |
1000000 |
100 100 |
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2014-04-09 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | Northern QF 2007.B |