No.1573 Divisor Function
タグ : / 解いたユーザー数 38
作問者 :
maguro
PCTprobability
Problem Statement
For positive integers $x,y$, define $f(x,y)=\displaystyle \sum_{i|x\ \land\ 1 \le i \le y}^{} (x+i)$.
In other words, $f(x,y)$ is the sum of $x+i$ over all divisors $i$ of $x$ that are at least $1$ and at most $y$.
Find $\displaystyle \sum_{i=1}^{n} f(i,m)$ modulo $998244353$.
Input
$n\ m$
- All inputs are integers.
- $1 \le n,m \le 10^9$
Output
Output $\displaystyle \sum_{i=1}^{n}f(i,m)$ modulo $998244353$.
Sample
Sample 1
Input
6 3
Output
60
$\{ (1 + 1) \} + \{ (2 + 1) + (2 + 2) \} + \{ (3 + 1) + (3 + 3) \} + \{ (4 + 1) + (4 + 2) \} + \{ (5 + 1) \} + \{ (6 + 1) + (6 + 2) + (6 + 3) \} = 60 $
Note that divisors exceeding $3$ are not added.
Sample 2
Input
2020 1000
Output
17124456
Sample 3
Input
1000000000 562967432
Output
954330278
Output the answer modulo $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。