#P8570. [JRKSJ R6] 牵连的世界

    ID: 9606 远端评测题 1700ms 256MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2022洛谷原创O2优化素数判断,质数,筛法莫比乌斯反演

[JRKSJ R6] 牵连的世界

Background

Problem Description

Given n,mn, m, find

i=1nj=1mσ0(ij)φ(ij)\sum_{i=1}^n \sum_{j=1}^m \sigma_0(ij)\varphi(ij)

Input Format

Two integers n,mn, m.

Output Format

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

5 5
453
20 20
173825

Hint

σ0,φ\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.

Subtask\text{Subtask} n,mn, m \le Score\text{Score}
11 10310^3 1010
22 10510^5 3030
33 2×1052\times 10^5
44 5×1055\times 10^5
55 3×1063\times 10^6 11

For all testdata, 1n,m3×1061 \le n, m \le 3\times 10^6.

For some reason, you only need to get 100\ge 100 points to pass this problem.

Translated by ChatGPT 5