#C7662. Maximum Absolute Difference

    ID: 51558 Type: Default 1000ms 256MiB

Maximum Absolute Difference

Maximum Absolute Difference

Given an array \(A\) of \(n\) integers, compute the absolute difference between the sum of the elements at even indices and the sum of the elements at odd indices. In other words, if we denote \(S_{even} = \sum_{i \text{ even}}A_i\) and \(S_{odd} = \sum_{i \text{ odd}}A_i\), you are to calculate \(|S_{even} - S_{odd}|\). This problem tests your ability to process arrays and handle input/output efficiently under large constraints.

inputFormat

The first line of input contains an integer \(t\) representing the number of test cases. Each test case consists of two lines:

  • The first line contains an integer \(n\), the number of elements in the array.
  • The second line contains \(n\) space-separated integers \(A_0, A_1, \dots, A_{n-1}\).

outputFormat

For each test case, output a single integer on a separate line, which is the absolute difference between the sum of elements at even indices and the sum of elements at odd indices.

## sample
1
5
1 2 3 4 5
3

</p>