Multiply left and right array sum.
Submissions: 9266   Accuracy:

54.3%

  Difficulty: Basic   Marks: 1

Pitsy needs help in the given task by her teacher. The task is to divide a array into two sub array (left and right) containing n/2 elements each and do the sum of the subarrays and then multiply both the subarrays.

Input:
First line consists of T test cases. Only line of every test case consists of an integer N.‚Äč

Output:
Print the answer by dividing array into left and right array and add their elements individually and then multiply both the array

Constraints:
1<=T<=100
1<=N<=1000
1<=Ai<=100

Example:
Input:

2
4
1 2 3 4
3
4 5 6
Output:
21
44

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Prashant shukla
Author: MITan5


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.



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


to report an issue on this page.