Олимпиадный тренинг

Задача 25961. Diplomas


When Petya was at 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 size: w — wide and h — in height. Now Petya is studying at one of the best Russian universities and lives in a hostel with his classmates. He decided to decorate his room by hanging his diplomas for school olympiads on one of the walls. Since it is rather difficult to attach diplomas to a concrete wall, he decided to buy a special cork board to attach it to the wall, and to it — diplomas. In order to make this design look more beautiful, Petya wants the board to be square and take up as little space as possible on the wall. Each diploma must be placed strictly in a rectangle measuring w by h. Diplomas must not be rotated 90 degrees. Rectangles corresponding to different diplomas must not have common interior points. It is required to write a program that will calculate the minimum size of the side of the board that Petya needs to place all his diplomas.

Input: 3 integers are input: w, h, n (\(1<=w,\ h,\ n <= 10^9\) ).
 
Output: You must output the answer to the problem.
 
Examples
# Input Output
1 2 3 10 9
2 1 1 1 1