#P2260. [清华集训 2012] 模积和

[清华集训 2012] 模积和

Description

{{Compute

$$\sum_{i=1}^{n} \sum_{j=1}^{m} (n \bmod i) \times (m \bmod j), i \neq j$$

the value modulo 19940417.}}

Input Format

{{The input contains a single line with two integers nn, mm.}}

Output Format

{{The answer modulo 19940417.}}

3 4
1
123456 654321
116430

Hint

{{Constraints

  • For 10% of the testdata, it is guaranteed that n,m103n, m \le 10^3.
  • For 30% of the testdata, it is guaranteed that n,m106n, m \le 10^6.
  • For another 30% of the testdata, it is guaranteed that n100n \le 100.
  • For 100% of the testdata, it is guaranteed that 1n,m1091 \le n, m \le 10^9.}}

Translated by ChatGPT 5