No.2127 Mod, Sum, Sum, Mod
問題文最終更新日: 2023-05-31 10:39:13
English (AI translation)
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
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もしくは右上の雲マークをクリックしてアカウントを作成してください。