結果
| 問題 |
No.3253 Banned Product
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-05 16:53:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 67 ms / 2,000 ms |
| コード長 | 398 bytes |
| コンパイル時間 | 437 ms |
| コンパイル使用メモリ | 82,804 KB |
| 実行使用メモリ | 65,972 KB |
| 最終ジャッジ日時 | 2025-09-05 16:54:00 |
| 合計ジャッジ時間 | 1,581 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
from math import isqrt
def solve():
n, k = map(int, input().split())
assert 1 <= k <= n <= 10 ** 9
while k <= n:
for d in range(1, isqrt(n)+1):
if n%d==0 and d <= k and n//d <= k:
break
else:
print(n)
return
n -= 1
print(-1)
return
t = int(input())
assert 1 <= t <= 10
for i in range(t):
solve()