Given an array A of integers find sum of product of all pairs of array elements.
First line consists of T test cases. First line of every test case consists of N, denoting number of elements of array. Second line consists of elements of array.
Single line output, print the sum of products.
1 3 4
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.