P3327 [SDOI2015] Sum of Divisor Counts

Description

Let $d(x)$ be the number of divisors of $x$. Given $n, m$, compute $$\sum_{i=1}^n\sum_{j=1}^m d(ij).$$

Input Format

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

Output Format

Output $T$ lines, each containing one integer, the required answer.

Explanation/Hint

Constraints For $100\%$ of the testdata, $1 \le T, n, m \le 50000$. Translated by ChatGPT 5