結果
| 問題 | No.2526 Kth Not-divisible Number |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-03 21:35:49 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 1,304 ms / 2,000 ms |
| コード長 | 460 bytes |
| 記録 | |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 84,864 KB |
| 実行使用メモリ | 94,464 KB |
| 最終ジャッジ日時 | 2026-04-12 23:09:36 |
| 合計ジャッジ時間 | 15,869 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
input = sys.stdin.readline
def solve():
a,b,k = map(int,input().split())
c = a*b//math.gcd(a,b)
l,r = 0,10**20
while r-l > 1:
m = (l+r)//2
cnt = m // a + m // b - m // c
if m - cnt >= k:
r = m
else:
l = m
print(r)
for _ in range(int(input())):
solve()