시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2.5 초 | 512 MB | 31 | 8 | 8 | 33.333% |
bobo is good at GCD (greatest common divisor) and LCM (least common multiple).
But today he gets stuck in summing up $\mathrm{lcm}(i, j)$ for all $1 \leq i \leq n, 1 \leq j \leq m$ with $\gcd(i, j) \leq a$, modulo $(10^9 + 7)$.
The first line contains an integer $q$, which denotes the number of questions ($1 \leq q \leq 10^4$).
Each of the following $q$ lines contains $3$ integers $n, m, a$, as described in the statement ($1 \leq n, m, a \leq 10^5$).
For each question, print a single integer denoting the sum.
2 2 2 1 3 4 2
5 45