結果

問題 No.2526 Kth Not-divisible Number
ユーザー nikoro256
提出日時 2023-11-03 21:51:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 390 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 82,332 KB
実行使用メモリ 77,200 KB
最終ジャッジ日時 2024-09-25 20:02:03
合計ジャッジ時間 10,401 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
print(10**5*math.log(10**18,2))
def isok(n):
    ans=n-n//A-n//B+n//math.lcm(A,B)
    if ans<K:
        return True
    return False

T=int(input())
for _ in range(T):
    A,B,K=map(int,input().split())
    left,right=0,3*10**18+1
    while right-left>1:
        mid=(right+left)//2
        if isok(mid):
            left=mid
        else:
            right=mid
    print(right)
0