P10670 BZOJ4174 tty's Help Request.
Description
Compute the value of the following expression modulo $998244353$, where $x$ is a real number and all other variables involved are integers:
$$\sum_{n=1}^N \sum_{m=1}^M \sum_{k=0}^{m-1} \lfloor \dfrac{nk+x}{m}\rfloor$$
Input Format
Input one line containing two positive integers $N, M$ and one real number $x$.
Output Format
Output one line containing one integer, representing the answer modulo $998244353$.
Explanation/Hint
Constraints: $1\leq N, M\leq 500000$, $0