## DWITE '08 R2 #3 - My drink is made of cubes

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
##### DWITE Online Computer Programming Contest, November 2008, Problem 3

In order to save on production cost, a company wants to find an optimal design for their new line of drink products. Given the volume of the contents, what is the minimum amount of material (surface area) needed to make a box? (This company is very cheap, and will sell their drinks in boxes).

An odd requirement is that the inside volume must be exact, and each side must be an integer value in length. (Note: that means that in some cases a box will use more material than a different box that could have held more volume.) (Also: it might help to think of contents as unit cubes, not liquid... but I already wrote the title).

The input will contain 5 lines, integers – target volume of the package.

The output will contain 5 lines, the surface area of the optimal box that fits the specifications.

Example calculation: for a volume of , the optimal box is a cube; so the surface area will be .

Again: if the volume is , then the optimal box is ; so the surface area will be .

Final note: make sure your program runs fast, even for large volumes.

#### Sample Input

27
15
1
1000
64000

#### Sample Output

54
46
6
600
9600