結果
問題 |
No.3253 Banned Product
|
ユーザー |
![]() |
提出日時 | 2025-09-05 21:49:18 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 955 ms / 2,000 ms |
コード長 | 720 bytes |
コンパイル時間 | 370 ms |
コンパイル使用メモリ | 82,728 KB |
実行使用メモリ | 67,276 KB |
最終ジャッジ日時 | 2025-09-05 21:49:22 |
合計ジャッジ時間 | 2,926 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 9 |
ソースコード
def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] T=int(input()) for _ in range(T): N,K=map(int,input().split()) if N>K*K: print(N) continue if N<=K: print(-1) continue for i in range(N,K,-1): div = make_divisors(i) f = True for d in div: if d<=K and i//d<=K: f = False break if f: print(i) break if not f: print(-1)