結果

問題 No.1926 Sequence of Remainders
ユーザー ripityripity
提出日時 2022-03-03 19:43:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 1,145 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 3,069 ms
コンパイル使用メモリ 73,624 KB
実行使用メモリ 58,740 KB
最終ジャッジ日時 2024-10-09 04:45:47
合計ジャッジ時間 44,285 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    
    public static Scanner sc = new Scanner(System.in);
    public static PrintWriter pw = new PrintWriter(System.out);
    
    public static void main(String[] args) {
        
        int t = sc.nextInt();
        while( t > 0 ) {
            solve();
            t--;
        }
        
        pw.flush();
        
    }
    
    static void solve() {
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        int K = sc.nextInt();
        pw.println( K%M < M-N ? K%M : 0 );
        
    }
    
}
0