結果

問題 No.2567 A_1 > A_2 > ... > A_N
ユーザー AngrySadEightAngrySadEight
提出日時 2023-11-24 01:24:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 340 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 83,328 KB
最終ジャッジ日時 2023-11-24 01:24:16
合計ジャッジ時間 4,966 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 82 ms
80,396 KB
testcase_02 AC 89 ms
82,600 KB
testcase_03 AC 83 ms
81,180 KB
testcase_04 AC 91 ms
81,952 KB
testcase_05 AC 90 ms
83,328 KB
testcase_06 AC 307 ms
77,032 KB
testcase_07 AC 301 ms
76,408 KB
testcase_08 AC 340 ms
77,300 KB
testcase_09 AC 295 ms
76,364 KB
testcase_10 AC 330 ms
77,416 KB
testcase_11 AC 38 ms
53,460 KB
testcase_12 AC 49 ms
64,460 KB
testcase_13 AC 38 ms
53,460 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 46 ms
62,348 KB
testcase_16 AC 41 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    N, X = map(int, input().split())
    if N * (N + 1) // 2 > X:
        print(-1)
        continue
    ans = [N - i for i in range(N)]
    X -= N * (N + 1) // 2
    div = X // N
    rem = X % N
    for i in range(N):
        if i < rem:
            ans[i] += (div + 1)
        else:
            ans[i] += div
    print(*ans)
0