AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

BAPC18-096.Cardboard Container

Medium · 1 s · 256 MB

  • icpc
  • bapc
  • 2018

Fidget spinners are so 2017; this years' rage are fidget cubes. A fidget cube is a cube with unit side lengths, which you hold in your hand and fidget with. Kids these days, right?

You work in the planning department for a company that creates and ships fidget cubes. Having done some market analysis, you found that your customers want to receive shipments of exactly VVV fidget cubes.

This means you have to design a container that will hold exactly VVV fidget cubes. Since fidget cubes are very fragile, you cannot have any empty space in your container. If there is empty space, they might move around, bump into each other and get damaged. Because of this, you decide to ship the fidget cubes in a rectangular cardboard box.

The cost of a cardboard box is proportional to its surface area, costing exactly one unit of money per square unit of surface area. Of course you want to spend as little money as possible. Subject to the above constraints, how much money do you have to spend on a box for VVV fidget cubes?

Giriş formatı

The input contains a single integer, 1≤V≤1061 \leq V \leq 10^61≤V≤106, the number of fidget cubes for which you need to build a box.

Çıxış formatı

Print the cost of the cheapest rectangular box as specified in the statement.

Qeyd

Source: Benelux Algorithm Programming Contest 2018 · Author: <author name> · License: CC BY-SA 4.0 · Original: https://bapc.eu · Statement adapted for AlgoLens and shared under the same license.

Nümunələr

Giriş #1

1

Çıxış #1

6

Giriş #2

4

Çıxış #2

16

Giriş #3

3

Çıxış #3

14

Giriş #4

5913

Çıxış #4

2790