You are given an array $$A$$ containing $$N$$ positive integers. Consider an array $$B$$ that also contains $$N$$ positive integers and it satisfies the following condition:
- For all $$i$$, consider $$j$$ such that \(1 \le i < j \le N, A_iB_i = A_jB_j\) holds correct.
Find the minimum possible value of \(B_1 + B_2 + ...+ B_N\) for array $$B$$. Since the answer can be large, print the sum modulo \(1000000007\).
Input format
- The first line contains an integer $$T$$ denoting the number of test cases.
- The first line of each test case contains a single integer $$N$$ denoting the size of the array $$A$$.
- The second line of each test case contains $$N$$ space-separated integers denoting the array $$A$$.
Output format
For each test case, print the sum modulo $$1000000007$$ in a new line.
Constraints
The sum of $$N$$ over $$T$$ test cases does not exceed $$200000$$.
For the first test case, the array \(B=[12,6,4,3]\). Thus, the minimum sum possible is $$25$$.
For the second test case, the array \(B=[60,30,20,15,12]\). Thus, the minimum sum possible is $$137$$.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor