eolymp
bolt
Try our new interface for solving problems
Problems

Diplomas

Diplomas

\includegraphics{https://static.e-olymp.com/content/63/63a0d3a1726a31eca4119c46da0b41f37b39ae75.jpg} When Peter was in school, he often participated in Olympiads in computer science, mathematics, and physics. Since he was a fairly capable boy and studied hard, he received diplomas at many of these Olympiads. By the end of school, he had accumulated $n$ diplomas, and, as it turned out, they all had the same dimensions: $w$ in width and $h$ in height. Now Peter studies at one of the best universities and lives in a hostel with his classmates. He decided to decorate his room by hanging his diplomas from school Olympiads on one of the walls. Since it is difficult to attach diplomas to a concrete wall, he decided to buy a special cork board to attach to the wall and hang diplomas on it. For this structure to look more beautiful, Peter wants it to be square and take up as little space on the wall as possible. Each diploma must be placed strictly in a $w * h$ rectangle. Diplomas must not be rotated $90$ degrees. Rectangles corresponding to different diplomas should not have common interior points. Write a program that computes the minimum size of the square board Peter needs to accommodate all his diplomas. \InputFile Three integers $w, h, n\:(1 \le w, h, n \le 10^9)$. \OutputFile Print the required minimum size of the square board.
Time limit 1 second
Memory limit 128 MiB
Input example #1
2 3 10
Output example #1
9