BETA

Difficulty Level: Medium

Submissions: 2597 Accuracy:

16.4%

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 Input/Output Examples Use 'Expected Output' option **

Contributor: Sonesh Shukla

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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