You are given an array of positive integers.
Choose one or more elements, keeping their original order, to form a subsequence . You may perform the following operation on the chosen subsequence any number of times.
For example, choosing for changes it to . You cannot divide only the while leaving the unchanged: you cannot choose which divisible elements are affected.
Use these operations to make all elements of equal. Let be the largest common value that can be obtained. Performing no operations is allowed, and making every element equal to is always possible.
For example, if , choosing gives , and then choosing gives . The largest attainable common value is , so . For a subsequence with one element, performing no operations is optimal, so .
Find the sum of over all nonempty subsequences , modulo .
Each subsequence starts independently from the original values. Operations on one subsequence do not affect any other subsequence. Subsequences chosen from different sets of indices are counted separately, even if their values are identical. For example, the array has three nonempty subsequences: using the first index, using the second index, and using both indices.
The input is given from Standard Input in the following format:
For each test case, print the sum of over all nonempty subsequences , modulo , on its own line.
For each test case, let .
The three singleton subsequences contribute , , and . For , choosing gives , and then choosing gives ; its maximum is . The maxima for , , and are all . The answer is .
The first line contains the number of test cases . Each case is given in the following format:
The first line of each case contains the array length . The second line contains its elements, separated by spaces.
| 3 | 19 | Every is square-free: no prime square divides . |
| 4 | 24 | In each test case, and . The sums of and over all test cases are each at most . |
| 5 | 37 | No additional constraints. |
In the first case, the three different index selections each have , giving . In the second case, repeatedly choosing for gives , then , then . The largest common value is , so the answer is . In the third case, each of the nonempty subsequences contributes .