結果

問題 No.1926 Sequence of Remainders
ユーザー AEn
提出日時 2022-05-11 17:55:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 76,800 KB
最終ジャッジ日時 2024-07-19 03:17:00
合計ジャッジ時間 14,849 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for i in range(T):
    N, M, K = map(int, input().split())
    a = K%M
    cnt = 1
    while cnt <= N:
        if a >= (M-cnt):
            a %= (M-cnt)
            cnt += 1
            if cnt > N:
                print(a)
        else:
            if a < (M-N):
                print(a)
                cnt = N+1
            else:
                print(0)
                cnt = N+1
0