結果

問題 No.3253 Banned Product
コンテスト
ユーザー ID 21712
提出日時 2025-12-19 01:47:43
言語 Go
(1.23.4)
結果
WA  
実行時間 -
コード長 356 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 13,065 ms
コンパイル使用メモリ 240,408 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2025-12-19 01:47:57
合計ジャッジ時間 13,299 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package main

import . "fmt"

func main() {
	var t int
	Scan(&t)
	for ; t > 0; t-- {
		var n,k,x int
		Scan(&n,&k)
		for x = n; x > 1 && x > n-10; x-- {
			ok := true
			for a:=1; a*a<=x&&a<=k; a++ {
				if x%a==0&&x/a<=k {
					ok = false
					break
				}
			}
			if ok {
				Println(x)
				x = -1
				break
			}
		}
		if x > 0 {
			Println(-1)
		}
	}
	
}
0