Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/qidiruv-jadvaldagi-k-son

k-th number in a multiplication table

Medium 1000 ms 128 MB 64%
Share

In a multiplication table with $n$ rows and $m$ columns, the cell at the intersection of row $i$ and column $j$ contains the number $i \cdot j$. If all $n \cdot m$ numbers of the table are written out in non-decreasing order, which number is in the $k$-th place?

A 3 by 3 multiplication table: the cells less than or equal to the given number are counted in each row

Input

One line with three positive integers: $n$, $m$ and $k$.

Output

One positive integer.

Note

$1 \le n, m \le 3 \cdot 10^{4}$
$1 \le k \le n \cdot m$

Examples

Input #1
3 3 5
Output #1
3
Input #2
2 3 6
Output #2
6

Sign in to submit a solution

Signing up is free and takes a minute.