結果

問題 No.1926 Sequence of Remainders
ユーザー nephrologistnephrologist
提出日時 2022-05-06 21:38:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 565 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 78,336 KB
最終ジャッジ日時 2023-09-20 02:31:11
合計ジャッジ時間 8,046 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,152 KB
testcase_01 AC 115 ms
77,600 KB
testcase_02 AC 119 ms
77,520 KB
testcase_03 AC 133 ms
78,008 KB
testcase_04 AC 136 ms
78,336 KB
testcase_05 AC 130 ms
78,060 KB
testcase_06 AC 123 ms
77,652 KB
testcase_07 AC 125 ms
77,384 KB
testcase_08 AC 125 ms
77,596 KB
testcase_09 AC 126 ms
77,484 KB
testcase_10 AC 132 ms
77,436 KB
testcase_11 AC 131 ms
77,764 KB
testcase_12 AC 130 ms
77,908 KB
testcase_13 AC 128 ms
77,376 KB
testcase_14 AC 130 ms
77,484 KB
testcase_15 AC 130 ms
77,504 KB
testcase_16 AC 131 ms
77,572 KB
testcase_17 AC 128 ms
77,460 KB
testcase_18 AC 129 ms
77,496 KB
testcase_19 AC 129 ms
77,632 KB
testcase_20 AC 131 ms
77,468 KB
testcase_21 AC 131 ms
77,576 KB
testcase_22 AC 132 ms
77,604 KB
testcase_23 AC 130 ms
77,592 KB
testcase_24 AC 126 ms
77,624 KB
testcase_25 AC 125 ms
77,756 KB
testcase_26 AC 123 ms
77,528 KB
testcase_27 AC 123 ms
77,500 KB
testcase_28 AC 126 ms
77,528 KB
testcase_29 AC 121 ms
77,500 KB
testcase_30 AC 125 ms
77,452 KB
testcase_31 AC 132 ms
77,464 KB
testcase_32 AC 133 ms
77,560 KB
testcase_33 AC 125 ms
77,136 KB
testcase_34 AC 127 ms
77,520 KB
testcase_35 AC 123 ms
77,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.buffer.readline

t = int(input())


def divide(n):
    res = set()
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            res.add(i)
            res.add(n // i)
    return res


for _ in range(t):
    n, m, k = map(int, input().split())

    num = k % m

    mn = m - n
    # yakusu = divide(num)
    # ans = -1
    # for a in yakusu:
    #     if mn <= a:
    #         ans = 0
    #         break
    # if ans == -1:
    #     ans = num % mn
    if mn <= num:
        print(0)
    else:
        print(num % mn)
0