#P4619. [SDOI2018] 旧试题

    ID: 3557 远端评测题 5000ms 512MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>2018各省省选山东O2优化枚举,暴力剪枝莫比乌斯反演

[SDOI2018] 旧试题

Description

Time flies, and it is the NOI Qualifier season again...

This is student QQ's second time taking the provincial team selection contest. This year, after learning a hard lesson, student QQ no longer takes the risk of stealing problems, but instead improves personal skills by practicing old problems. However, there are too many old problems. Student QQ works on them day and night, yet still cannot see where the light ahead is.

One day, exhausted from doing too many problems, student QQ fell asleep and dreamed that, in the exam room, he encountered a problem that seemed familiar, but he could not remember how he had solved it before. Even after waking up, he was still frightened.

Student QQ frowned, feeling that something was wrong, so he came to you and hoped you could teach him how to solve this problem. Student QQ vaguely remembered that the task was to compute the value of the following expression:

$$(\sum_{i=1}^{A}\sum_{j=1}^{B}\sum_{k=1}^{C}d(ijk))\bmod (10^9+7)$$

Here, d(ijk)d(ijk) denotes the number of divisors of i×j×ki \times j \times k.

Input Format

The first line contains a positive integer TT, meaning there are TT groups of testdata.

The next TT lines each describe one group of testdata, containing three integers A,B,A, B, and CC, with meanings as described above.

Output Format

For each group of testdata, output one line containing one integer, which is the value of the required expression.

5
10 10 10
100 100 100
1000 1000 1000
10000 10000 10000
100000 100000 100000
11536
51103588
165949340
19234764
176764584

Hint

For the testdata worth 3030 points, 1A,B,C50001 \le A, B, C \le 5000.

For the testdata worth 100100 points, 1T101 \le T \le 10, 1A,B,C1051 \le A, B, C \le 10^5, and 1max(A,B,C)2×1051 \le \sum \max(A, B, C) \le 2 \times 10^5.

Translated by ChatGPT 5