結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー hiro1729hiro1729
提出日時 2023-12-02 15:15:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 393 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 83,348 KB
最終ジャッジ日時 2023-12-02 15:15:55
合計ジャッジ時間 4,679 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,460 KB
testcase_01 AC 78 ms
80,288 KB
testcase_02 AC 84 ms
82,500 KB
testcase_03 AC 81 ms
81,276 KB
testcase_04 AC 83 ms
82,476 KB
testcase_05 AC 85 ms
83,348 KB
testcase_06 AC 383 ms
78,008 KB
testcase_07 AC 383 ms
77,956 KB
testcase_08 AC 356 ms
78,204 KB
testcase_09 AC 393 ms
77,828 KB
testcase_10 AC 373 ms
77,664 KB
testcase_11 AC 43 ms
53,460 KB
testcase_12 AC 51 ms
64,476 KB
testcase_13 AC 39 ms
53,460 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 49 ms
62,360 KB
testcase_16 AC 39 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
	n, x = map(int, input().split())
	if n * (n + 1) // 2 > x:
		print(-1)
	else:
		a = list(range(n, 0, -1))
		x -= sum(a)
		c = x // n
		for i in range(n):
			a[i] += c
		x %= n
		for i in range(x):
			a[i] += 1
		print(*a)
0