The Service Club is famous in Sōbu High School for their ability to find the optimal solution to problems, albeit not always the prettiest. One day, Isshiki Iroha, the student council president, goes to the Service Club to ask for help with student council work again. To Hikigaya Hachiman and Yukinoshita Yukino's dismay, Yuigahama Yui, being the nice girl that she is, offers to help her.
Your job is to help the Service Club solve the student council's job, as Hikigaya is too lazy to do it himself and Yukinoshita Yukino is currently busy for some reason.
The student council is to create a rectangular flower garden given units of soil then fence it off using the least amount of fencing to save as much of the student council budget as possible. What is the minimum amount of fencing required to fence off all the soil given that the side lengths of the garden must be integers?
Quote
Oh yeah? Good on you to notice. You're right, I am nice. I've been through all kinds of things in my life, but I haven't gone out for revenge on a single person at all. If I was any other normal person, this world would've ended already. You could even call me the savior of the world.
-Hikigaya Hachiman
Input Specification
The input will consist of integer , the amount of soil the student council is given.
Output Specification
Output , the minimum amount of fencing required to fence off the garden.
Sample Input 1
16
Sample Output 1
16
Explanation for Sample Output 1
has smallest perimeter .
Sample Input 2
90
Sample Output 2
38
Explanation for Sample Output 2
has smallest perimeter .
Comments
Is this a math contest?
Yes.