Another Contest 5 Problem 1 - Goat Fence

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 1.0s
Memory limit: 256M

Problem type

Tudor is building a pen for his N goats. N goats need a rectangular pen with area exactly N square meters to roam.

Tudor needs to buy some fencing to demarcate the pen. The fencing comes in one meter units, so the rectangular pen must have side lengths that are an integer number of meters.

Tudor will randomly select, among all such possible rectangular pens with area N square meters, one pen to build. Compute the minimum amount of fencing, in meters, that Tudor needs to buy to guarantee that he can build the randomly selected pen.

Constraints

1 \le N \le 100

Input Specification

The first and only line of input contains a single positive integer, N.

Output Specification

Output the minimum amount of meters of fencing Tudor must buy.

Sample Input

1

Sample Output

4

Comments


  • -3
    Mikehole  commented on March 19, 2020, 6:08 p.m. edited

    Nvm


  • 0
    Togohogo1  commented on Jan. 10, 2020, 5:32 p.m. edited

    Edit: I understand it now


  • 0
    BULLET999  commented on Jan. 7, 2020, 9:37 p.m.

    big bruh moment


  • 2
    redfirearne  commented on July 25, 2019, 7:37 p.m. edit 2

    Why am I getting Presentation Error, check your whitespace?

    Edit: I know it means that I have either too many whitespaces or I'm missing some. But I don't have any whitespaces in my output, and I don't think we need to in this question?


    • 3
      wleung_bvg  commented on July 25, 2019, 7:44 p.m.

      If you look at the contest page, you will see that it states the following:

      The contest will follow the standard convention of having all lines terminate in a \n character.