~/algor $ cat problems/qidiruv-diplomlar
A board for diplomas
Medium
1000 ms
128 MB
66%
$n$ identical diplomas of width $w$ and height $h$ must be hung on a square board. The diplomas are not rotated (the width is horizontal), do not overlap and do not stick out of the board; they are laid out on the board in rows and columns. What is the smallest possible side of the board?
Input
One line with three positive integers: $w$, $h$ and $n$.
Output
One positive integer — the smallest side of the board.
Note
$1 \le w, h, n \le 10^{9}$
Examples
Input #1
2 3 10
Output #1
9
Input #2
1 1 1
Output #2
1