CF448D.Multiplication Table

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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×mn×m multiplication table, where the element on the intersection of the ii -th row and jj -th column equals iji·j (the rows and columns of the table are numbered starting from 1). Then he was asked: what number in the table is the kk -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 nmn·m numbers from the table in the non-decreasing order, then the kk -th number you write out is called the kk -th largest number.

输入格式

The single line contains integers nn , mm and kk (1<=n,m<=5105; 1<=k<=nm)(1<=n,m<=5·10^{5}; 1<=k<=n·m) .

输出格式

Print the kk -th largest number in a n×mn×m multiplication table.

输入输出样例

  • 输入#1

    2 2 2
    

    输出#1

    2
    
  • 输入#2

    2 3 4
    

    输出#2

    3
    
  • 输入#3

    1 10 5
    

    输出#3

    5
    

说明/提示

A 2×32×3 multiplication table looks like this:

<br></br>1 2 3<br></br>2 4 6<br></br><br></br>

首页