#P3327. [SDOI2015] 约数个数和

    ID: 2376 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>数学2015山东最大公约数,gcd莫比乌斯反演

[SDOI2015] 约数个数和

Description

Let d(x)d(x) be the number of divisors of xx. Given n,mn, m, compute

i=1nj=1md(ij).\sum_{i=1}^n\sum_{j=1}^m d(ij).

Input Format

The input contains multiple test cases.
The first line contains an integer TT, the number of test cases.
Each of the next TT lines contains two integers n,mn, m.

Output Format

Output TT lines, each containing one integer, the required answer.

2
7 4
5 6
110
121

Hint

Constraints
For 100%100\% of the testdata, 1T,n,m500001 \le T, n, m \le 50000.

Translated by ChatGPT 5