Meena has an array of length N (1-indexed). The numbers of the array are arranged from left to right (the leftmost element's index being 1 and the rightmost's index being N).
Meena does the following until the array is completely empty: she will pick one number at random from all the remaining numbers of the array. The sum of all numbers to the right of the chosen number (if there are any) will be added to her score (initially, her score is 0). Then the chosen number and all the numbers to its right will be discarded from the array. Then with the remaining numbers of the array, she will continue the same process until the array is completely empty.
Your task is to find the expected value of Meena's score after she's done with the array. It can be shown that the expected value can be represented as P/Q where P and Q are co-prime integers. Print the value of (mod 1000000007).
The first line of input contains an integer T which denotes the number of test cases.
The first line of each test case contains a single integer N denoting the length of the array. The second line of each test case contains N space-separated integers , , , … denoting the numbers of the array.
1 ≤ T ≤ 25
2 ≤ N ≤
1 ≤ ≤ for 1 ≤ i ≤ N
For each test case, first print the serial number of the test case, followed by Meena's expected score written as (mod 1000000007). Please check the sample input-output section for formatting details.
2 2 4 8 3 1 1 1
Case 1: 4 Case 2: 166666669
For the first case, the expected value is . So the answer is (mod 1000000007) which is 4.
For the second case, the expected value is . So the answer is (mod 1000000007) which is 166666669.