結果

問題 No.2560 A_1 < A_2 < ... < A_N
ユーザー nikosho
提出日時 2023-12-02 15:03:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 341 ms / 2,000 ms
コード長 303 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 88,192 KB
最終ジャッジ日時 2024-09-26 17:57:43
合計ジャッジ時間 4,252 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())

for i in range(t):
    n, x = map(int,input().split())
    if x >= sum(range(1, n + 1)):
        j = 1
        ans = []
        while n>1:
            ans.append(j)
            x-=j
            j+=1
            n-=1
        ans.append(x)
        print(*ans)
    else:
        print(-1)
0