GCD vs LCM

아직 제출이 없습니다시간 제한2.5초메모리 제한512 MB

문제

bobo is good at GCD (greatest common divisor) and LCM (least common multiple).

But today he gets stuck in summing up lcm(i,j)\mathrm{lcm}(i, j) for all 1in,1jm1 \leq i \leq n, 1 \leq j \leq m with gcd(i,j)a\gcd(i, j) \leq a, modulo (109+7)(10^9 + 7).

입력

The first line contains an integer qq, which denotes the number of questions (1q1041 \leq q \leq 10^4).

Each of the following qq lines contains 33 integers n,m,an, m, a, as described in the statement (1n,m,a1051 \leq n, m, a \leq 10^5).

출력

For each question, print a single integer denoting the sum.