結果
問題 |
No.2526 Kth Not-divisible Number
|
ユーザー |
👑 |
提出日時 | 2023-07-07 00:01:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 976 ms / 2,000 ms |
コード長 | 228 bytes |
コンパイル時間 | 272 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 76,416 KB |
最終ジャッジ日時 | 2024-09-25 19:10:02 |
合計ジャッジ時間 | 6,763 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
I=input for t in range(int(I())): A,B,K=map(int,I().split()) C,D=A,B if A>B:C,D=D,C while C:C,D=D%C,C C=A*B//D N=int((K+1)/(1-1/A-1/B+1/C)) while N-N//A-N//B+N//C>=K:N-=1 while N-N//A-N//B+N//C<K:N+=1 print(N)