시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2.5 초 512 MB 0 0 0 0.000%

문제

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.

예제 입력 1

2
2 2 1
3 4 2

예제 출력 1

5
45