結果

問題 No.2452 Incline
ユーザー KudeKude
提出日時 2023-09-01 21:38:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 87,328 KB
実行使用メモリ 79,416 KB
最終ジャッジ日時 2023-09-01 21:38:24
合計ジャッジ時間 4,267 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 70 ms
71,416 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 366 ms
78,740 KB
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
def f(r, m, n):
    mq, mr = divmod(m, n)
    rq, rr = divmod(r, n)
    return (mq * rq + mr * rq + mq * rr + min(mr, rr)) % mod


for _ in range(int(input())):
    n, m, l, r = map(int, input().split())
    print((f(r + 1, m + 1, n - 1) - f(l, m + 1, n - 1)) % mod)
0