結果

問題 No.2493 K-th in L2 with L1
ユーザー hiro1729hiro1729
提出日時 2023-10-06 21:27:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 76,540 KB
最終ジャッジ日時 2023-10-06 21:27:03
合計ジャッジ時間 1,766 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 91 ms
76,480 KB
testcase_02 AC 89 ms
76,540 KB
testcase_03 AC 87 ms
76,448 KB
testcase_04 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
	d, k = map(int, input().split())
	if k > 4 * d:
		print("No")
	else:
		print("Yes")
		a = []
		for i in range(-d, d + 1):
			if i == -d or i == d:
				a.append((i, 0))
			else:
				a.append((i, min(d + i, d - i)))
				a.append((i, -min(d + i, d - i)))
		a.sort(key = lambda x: x[0] * x[0] + x[1] * x[1])
		print(*a[k - 1])
0