結果

問題 No.1926 Sequence of Remainders
ユーザー tnakao0123
提出日時 2022-05-08 18:55:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 40,192 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 07:06:23
合計ジャッジ時間 6,896 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 1926.cc:  No.1926 Sequence of Remainders - yukicoder
 */

#include<cstdio>
#include<algorithm>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int tn;
  scanf("%d", &tn);

  while (tn--) {
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);

    k %= m;
    if (k >= m - n) k = 0;

    printf("%d\n", k);
  }
  return 0;
}
0