#nt1005. LCMSUM2

LCMSUM2

LCMSUM2

Problem Description

There are TT queries. Each query gives two numbers n,mn, m; compute $\left(\sum_{i=1}^n \sum_{j=1}^m [i, j]\right) \bmod 2^{60}$, where [i,j][i, j] denotes the least common multiple of ii and jj.

Input Format

The first line contains one integer TT.

Each of the next TT lines contains two integers n,mn, m.

Output Format

Output TT lines, each containing one number: the answer.

Sample Input

3
100 200
1000 2000
1000000 2000000

Sample Output

73830168
731817128790
282228897746124034

Constraints

For all test cases, 1≤T≤10001 \le T \le 1000 and 1≤n,m≤1071 \le n, m \le 10^7.