SP26108 TRENDGCD - Trending GCD

Description

Problem statement is simple. Given **A** and **B** you need to calculate **S(A,B) .** ![sigma(a=1 to A)sigma(b=1 to B) (a*b*f(gcd(a,b)))](http://s29.postimg.org/qnxglb8mf/pic.png "TRENDGCD problem statement") Here, **f(n)=n, if n is square free otherwise 0**. Also **f(1)=1**.

Input Format

The first line contains one integer **T** - denoting the number of test cases. **T** lines follow each containing two integers **A,B**.

Output Format

For each testcase output the value of S(A,B) mod 1000000007 in a single line.