結果

問題 No.2526 Kth Not-divisible Number
ユーザー komkompikomkompi
提出日時 2023-11-03 22:00:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 645 ms
コンパイル使用メモリ 81,840 KB
実行使用メモリ 75,868 KB
最終ジャッジ日時 2023-11-03 22:01:02
合計ジャッジ時間 6,919 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 38 ms
53,516 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

T=int(input())

for _ in range(T):
    A,B,K=map(int,input().split())
    
    high=3*10**18
    low=-1
    
    while high-low>1:
        middle=(high+low)//2
        
        yaku_A=middle//A
        yaku_B=middle//B
        yaku_AB=middle//(A*B)
        
        all_unyaku=middle-yaku_A-yaku_B+yaku_AB
        
        if all_unyaku>=K:
            high=middle
        else:
            low=middle
    
    print(high)
    





0