結果

問題 No.2845 Birthday Pattern in Two Different Calendars
ユーザー i_taku
提出日時 2024-09-30 13:57:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 385 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 119,816 KB
最終ジャッジ日時 2024-09-30 13:58:03
合計ジャッジ時間 7,060 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    K, M, N = map(int, input().split())
    used = set()
    A = []
    for a in range(1, K + 1):
        b = (a + M - 2) % K + 1
        if a != b and a not in used and b not in used:
            used.add(a)
            used.add(b)
            A.append(a)
    if len(A) < N:
        print('No')
    else:
        print('Yes')
        print(*A[:N])
0