結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー tonegawa
提出日時 2023-12-03 13:14:10
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 553 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 16,896 KB
最終ジャッジ日時 2024-09-26 22:07:58
合計ジャッジ時間 5,091 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
  n, x = map(int, input().split())
  if n * (n + 1) // 2 > x:
    print(-1)
    return

  ans = []
  for i in range(0, n):
    if i == n - 1:
      ans.append(x)
    else:
      ans.append(i + 1)
      x -= i + 1
  print(*ans)



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