Sum of GCD
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
For the given positive integers , find the sum of the GCD (greatest common divisor) of all possible pairs of these numbers.
Input
The first line contains the number of test cases . Each test consists of one line containing the number , followed by positive integers. All input integers do not exceed .
Output
For each test, print the sum of the GCDs of all possible pairs on a separate line.
Examples
Input #1
Answer #1
Note
The answer for the third example is
Submissions 2K
Acceptance rate 62%