• 125

## Goal

Bob is playing LEGO. He has N small bricks. Each brick is a cube 1x1x1.
Using ALL the bricks, Bob is building a big "block". This block should be a plain cuboid (i.e. no empty space inside).

Bob is interested in the external surface of the block (=sum of the area of the 6 faces) he has constructed.
What are the minimum and maximum possible surface areas for his block?
Input
An integer N, the number of small bricks
Output
One line, with two integers separated by space.
First integer is the minimum surface.
Second integer is the maximum surface.
Constraints
1 <= N <= 1 500 000
Example
Input
1
Output
6 6

A higher resolution is required to access the IDE

Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
Online Participants