日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Codeforces Round #256 (Div. 2) D Multiplication Table

發(fā)布時間:2025/6/17 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Codeforces Round #256 (Div. 2) D Multiplication Table 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

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.

Input

The single line contains integers n, m and k (1?≤?n,?m?≤?5·105;?1?≤?k?≤?n·m).

Output

Print the k-th largest number in a n?×?m multiplication table.

Sample test(s) Input 2 2 2 Output 2 Input 2 3 4 Output 3 Input 1 10 5 Output 5 Note

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


1 2 3
2 4 6 1 #include <stdio.h> 2 int a, b; 3 long long c; 4 int main(){ 5 scanf("%d%d%lld", &a, &b, &c); 6 long long s = 1, e = (long long)a * b; 7 int i, j; 8 for(; !(s == e); ){ 9 long long m = (s + e) / 2; 10 long long cc = 0; 11 j = b; 12 for(i = 1; i <= a; i++){ 13 while((long long)i * j > m) j--; 14 cc += j; 15 } 16 if(cc < c) s = m + 1; 17 else e = m; 18 } 19 printf("%lld\n", s); 20 return 0; 21 } View Code

轉(zhuǎn)載于:https://www.cnblogs.com/qscqesze/p/3852507.html

總結(jié)

以上是生活随笔為你收集整理的Codeforces Round #256 (Div. 2) D Multiplication Table的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。