Why is Melody so chocolaty?
Submissions: 2064   Accuracy:

41.37%

  Difficulty: Basic   Marks: 1

Chunky gets happy by eating Melody.
Given an array of N elements each element represent happiness chunky get by eating melody.
Chunky knows why melody is so chocolaty but will only tell you once you tell him the Max happiness he can get by eating two adjacent melodies.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of two lines. First line of each test case contains an integer N and the second line contains N space separated array elements.

Output:
For each test case, print the Maximum Happiness in new line.

Constraints:
1 <= T <= 100
1 <= N <= 100000
-100000 <= A[i] <= 100000

 

Example:

Input:
2
5
1 2 3 4 5
4
5 2 3 4

Output:
9
7

 

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

Contributor: chunky_2808
Author: Chunky_2808


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.