Time

16:04:44
22 May 2012
Version for print

Match’s model

prb3

   Samodelkin, Professor decided make by hand volumetric model bricks from matches, and use the matches for edges. Length of edges of every brick equally for one match.

   For model’s construction of three bricks he uses 28 matches.

  What least quantity of matches Samodelkin needs for construction of model with N bricks?

  Every number of problems does not exceed 2·109.


Specifications

   Input

   One number N is quantity of bricks.

   Output

   One number is quantity of matches.


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 8.33333
Complexity: 83% 257/1517
Autor: Æóêîâñêèé Ñ. Ñ.
Source: Æèòîìèðñêàÿ îáëàñòíàÿ îëèìïèàäà
Classes: Modeling, Simple mathematics

Example

Example input

3	

Example output

28


← Digits Problems Two circles →