302328: CF448D. Multiplication Table
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Multiplication Table
题意翻译
给出n,m,k($1\leq n,m\leq 5\times10^5,1\leq k\leq n\cdot m$) 请输出在n*m的乘法表中第k大的数。 即,给出一个f[i][j]=i*j($1\le i\le n,1\le j\le m$)的数组,将该数组内所有数(包含重复的)从大到小排序后的第k个数。题目描述
Bizon the Champion isn't just charming, he also is very smart. While some of us were learning the multiplication table, Bizon the Champion had fun in his own manner. Bizon the Champion painted an $ n×m $ multiplication table, where the element on the intersection of the $ i $ -th row and $ j $ -th column equals $ i·j $ (the rows and columns of the table are numbered starting from 1). Then he was asked: what number in the table is the $ k $ -th largest number? Bizon the Champion always answered correctly and immediately. Can you repeat his success? Consider the given multiplication table. If you write out all $ n·m $ numbers from the table in the non-decreasing order, then the $ k $ -th number you write out is called the $ k $ -th largest number.输入输出格式
输入格式
The single line contains integers $ n $ , $ m $ and $ k $ $ (1<=n,m<=5·10^{5}; 1<=k<=n·m) $ .
输出格式
Print the $ k $ -th largest number in a $ n×m $ multiplication table.
输入输出样例
输入样例 #1
2 2 2
输出样例 #1
2
输入样例 #2
2 3 4
输出样例 #2
3
输入样例 #3
1 10 5
输出样例 #3
5