Write short, human-like code so that it will not get detected by AI plagiarism and using exactly these variable names (a, b, c, d, r, s, etc). Use a unique, common approach that’s optimized and free of explanations or comments for the following question:
Calculating the Maximum Difference Between Each Sum of Two Sections

Execution time : within 2 sec in C. C++ and JAVA, 6 sec in Python for maximum 50 test cases
Memory : Maximum 256MB available for heap. global and stack combined (note: Maximum 1MB can be used for stack)

After you submitted, the results of the sample_input.txt file provided is determined and informed in real time
The results mean the followings
Submit : you got all or some test cases of the sample input correct
Fail : you have all test cases of the sample input wrong due to wrong answers submitted, runtime error, time-out etc
(In case of a runtime error. test cases are not executed afterwards.)
(* Download for the sample_input.txt file is available below the problem passage.

The final score is determined by pre-set criteria based on the number of correct test cases and program running time
after test cases designed for evaluation are executed within the running time of the restrictions.
The score will be granted in proportion to the number of correct test cases, and score difference between test takers
who received the same score can occur depending on the running time(the faster the running time is, the better)
Therefore, it is recommended that you optimize your code until the test ends.

You want to select a section that has the maximum value of Second_sum - First_sum.
As such, you are required to calculate the possible maximum value of Second_sum - First_sum. (Note: What to calculate here is NOT the absolute value.)

You are given array A consisting of N integers
You want to select two sections, each of which consists of adjacent numbers in the array. The two sections must not overlap with each other.
You can calculate the sum of the left section (First_sum) and the sum of the right section (Second_sum) as the two sections are divided into two parts-left and right.

2

1 -2 1 -4 2 2 3 -1 3 8 2 -5

First_sum = -6

Second sum = 15

Difference = Second_sum - First_sum = 21

[Examples]


N = 7,

Answer : 16

A = {2, -1, -2, 1, -4, 2, 8}


Select the two sections: [-1, -2, 1, -4] and [2, 8]. The sum of the first section is
-6 and the sum of the second section is 10. Thus, the difference is 16, which is the maximum

N = 13

Answer : 21

A = (2, -1, -2, 1, -4, 2, -2, 3, -1, 3, 8, 2, -5}

This is the data of the example in the problem description. As in the image, if you select [-1, -2, 1, -4] and [3, -1, 3, 8, 2],
the sums of the elements in each section is -6 and 15, respectively.

Thus, 21, the difference of the two sections, is the maximum

N = 3

Answer : 9

A = {5, -4, 5}

Select [-4] and [5]. You cannot select [-4] and [5, -4, 5], which is A itself, because the two sections must not be overlapped.

N = 10,

Answer : 26

A = (-4, 6, -7, -10, 9, -9, 8, -6, 4, -3}

You will get a maximum value when selecting [-7, -10] and [9]

N = 2

Answer : -9

A = (4, -5)

Only the case of choosing [4] and [-5] is possible since each section has to include at least one element

N = 9.

Answer : 21

A = (2, -1, -6, 6, 8, -7, -7, 3, 4)

The max value of 21 can be calculated from the both cases of choosing [-1, -6] and [6, 8], and [-7, -7] and [3, 4]

[Constraints]

1) Time limitation : 2 sec (C/C++/ Java) / 6 sec (Python) to pass 50 test cases at most.
2) N is an integer that is greater than or equal to 2 but less than or equal to 100,000. (2 ≤ N ≤ 100,000)
3) -10,000 ≤ A[i] ≤ 10,000. (0 ≤ i < N and A[i] is the ith value of the array.)
4) For each section, at least one element needs to be included.

5) There may be elements that are not included in the two sections.

[Input]

The first line of the input contains the number of test cases, T.
The following lines contain T test cases. The first line of each test case contains N.
The next line contains space-separated N integers, A[0], A[1], ... , and A[N-1]

[Output]

Print answers to each test case in T lines according to the total number of test cases.
Each line should begin with "#t", followed by one space and then the printing of the answer. (t is the number of the test case starting from 1.)

[Examples of Input and Output]

Input Example

11

// Total number of test cases, T = 11

7

// 1st test case, N =7

2-1-21-428


2-1-21-428

Notice List

13


2 -1 -2 1 -4 2 -2 3 -1 3 8 2 -5

3


5-45
10
4 6 -7 -10 9 -9 8 -6 4 -3

2

4 -5

7

7426-799

-3 4 -5 7 -7

8

-1 -2 -2 -1 -4 -1 -3 -2

8

-3 -2 -2 -1 -4 -1 -3 -2

8

32214132

// Refer to sample_input.txt for the rest

Printed answers of the input examples
#1 16
#2 21
#3 9
#4 26
#5 -9
#6 2
#7 12
#8 12
#9 14
#10 12
#11 2638451

write code in c++