P8570 [JRKSJ R6] The Connected World.

Background

![](https://cdn.luogu.com.cn/upload/image_hosting/jdi9nrec.png)

Description

Given $n, m$, find $$\sum_{i=1}^n \sum_{j=1}^m \sigma_0(ij)\varphi(ij)$$

Input Format

Two integers $n, m$.

Output Format

Output one integer, representing the answer. The answer should be taken modulo $10^9+7$.

Explanation/Hint

$\sigma_0, \varphi$ are the divisor-counting function and Euler's totient function, respectively. This problem may be slightly tight on constant factors. ### Constraints This problem uses bundled subtasks. | $\text{Subtask}$ | $n, m \le$ | $\text{Score}$ | | :----------: | :----------: | :----------: | | $1$ | $10^3$ | $10$ | | $2$ | $10^5$ | $30$ | | $3$ | $2\times 10^5$ | $30$ | | $4$ | $5\times 10^5$ | $30$ | | $5$ | $3\times 10^6$ | $1$ | For all testdata, $1 \le n, m \le 3\times 10^6$. For some reason, you only need to get $\ge 100$ points to pass this problem. Translated by ChatGPT 5