結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー RYOH2718
提出日時 2023-12-02 16:58:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 88,576 KB
最終ジャッジ日時 2024-09-26 20:56:57
合計ジャッジ時間 2,845 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 10 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

def INT():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(map(int, input().split()))


def INT():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(map(int, input().split()))


T = INT()
for _ in range(T):
    N, X = MI()
    if N * (N + 1) // 2 > X:
        print(-1)
        continue

    A = []
    for i in range(N, 1, -1):
        A.append(i)
        X -= i

    A.append(X)

    A.sort(reverse=True)
    if A[0] == A[1] and N > 1:
        A[0] += 1
        A[-1] -= 1
    print(*A)
0