Problem5654--Packing Rectangles

5654: Packing Rectangles

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

There are $n$ rectangles of the same size: $w$ in width and $h$ in length. 
It is required to find a square of the smallest size into which these rectangles can be packed. Rectangles cannot be rotated.

Input

The input contains three integers $w,\ h,\ n\ (1≤w,\ h,\ n≤10^9)$.

Output

Output the minimum length of a side of a square, into which the given rectangles can be packed.

Sample 1 Input

2 3 10

Sample 1 Output

9

Source/Category

基础算法 4.15.二分