Multiplication table - MarisaOJ: Marisa Online Judge

Multiplication table

Time limit: 1000 ms
Memory limit: 256 MB
Given a table $A$ consisting of $n$ rows and $m$ columns, where each element at row $i$, column $j$ is $i \times j$ ($A_{i, j} = i \times j$). Rows are numbered from $1$ to $n$, and columns are numbered from $1$ to $m$. If all elements in the table are sorted in non-decreasing order, what is the value of the $k$-th element? ### Input - The first line contains three integers $n, m, k$. ### Output - Print the value of the $k$-th element. ### Constraints - $1 \le n, m \le 10^5$. - $1 \le k \le n \times m$. ### Sample Input: ``` 3 3 6 ``` Output: ``` 4 ```