BETA

Submissions : 2221 Accuracy :

15.94

Sum of Subarrays
         

Given an array A with N elements , you need to find the sum all sub arrays of array A. Since the sum could be very large print the sum modulo (10^9+7).

Input :
The first line contains integer T, denoting number of test cases. The first line of each test case contains an integer N, denoting the number of elements.The second line of each test case contains N space separated integers denoting values of the array A.


Output :
Print the answer of each test case in a new line.

Constraints :
1<=T<=100
1<=N<=10^5

Example
Input :

2
3
1 2 3
2
1 3

Output :
20
8

**For More Examples Use Expected Output**


Contributor: Sonesh Shukla

Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.