結果

問題 No.3253 Banned Product
ユーザー lif4635
提出日時 2025-09-05 05:07:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 60,500 KB
最終ジャッジ日時 2025-09-05 05:29:16
合計ジャッジ時間 1,285 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import isqrt

def solve():
    n, k = map(int, input().split())
    while k <= n:
        for d in range(1, 10 ** 5):
            if n%d==0 and d <= k and n//d <= k:
                break
        else:
            print(n)
            return
        n -= 1
    print(-1)
    return 

t = int(input())
for i in range(t):
    solve()
0