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×j (Ai,j=i×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≤n,m≤105. - 1≤k≤n×m. ### Sample Input: 336 Output: 4