問題一覧 > 通常問題

No.2127 Mod, Sum, Sum, Mod

レベル : / AI推定難易度 : 1625 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 36
作問者 : 👑 qand / テスター : 👑 p-adic 👑 potato167
お気に入りにしたユーザー ProblemId : 8760 / 自分の提出
問題文最終更新日: 2023-05-31 10:39:13
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 368 (順位表) の他の問題:

Problem Statement

You are given integers $N,M$.
Find $\displaystyle \sum_{i=1}^N \sum_{j=1}^M i\% j$ modulo $998244353$.
Here, $i\% j$ denotes the remainder when $i$ is divided by $j$.

Constraints

  • $1\le N,M\le 10^9$
  • All inputs are integers.
  • Input

    $N$ $M$
    

    Output

    Print $\displaystyle \sum_{i=1}^N \sum_{j=1}^M i\% j$ modulo $998244353$.

    Sample

    Sample 1
    Input
    2 3
    Output
    4

    We have $1\% 1+1\% 2+1\% 3+2\% 1+2\% 2+2\% 3=0+1+1+0+0+2=4$. Therefore, print $4$.

    Sample 2
    Input
    1 1
    Output
    0

    Since $1\% 1=0$, the answer is $0$.

    Sample 3
    Input
    998244353 998244353
    Output
    724196891

    Print the remainder when divided by $998244353$.

    提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。