Tudor is building a pen for his goats. goats need a rectangular pen with area exactly 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 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
Input Specification
The first and only line of input contains a single positive integer, .
Output Specification
Output the minimum amount of meters of fencing Tudor must buy.
Sample Input
1
Sample Output
4
Comments
But for this question, you don't need a \n? Did they change it, because when I submitted, you didn't need a \n an if you put a \n it gives a presentation error instead?
It says in the contest page that you need a \n
PrintStream.println
in Java already adds a newline character at the end of the line. SoSystem.out.println("123");
follows the required format and so doesSystem.out.print("123\n");
.Once again, I'm dumb
TIL that I can't read.
same. I thought you were supposed to output the minimum fencing. Oops.
This comment is hidden due to too much negative feedback. Show it anyway.
It doesn't matter if is a perfect square or not, all areas can be represented with at least 1 rectangular pen.
big bruh moment
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?
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.