#C11204. Array Reversal Sum

    ID: 40495 Type: Default 1000ms 256MiB

Array Reversal Sum

Array Reversal Sum

You are given an array A of size N. You are allowed to perform exactly one reversal operation on any contiguous subarray of A. However, note that reversing any subarray does not change the total sum of the array. In other words, if you let \(S = \sum_{i=1}^{N} a_i\), then after performing the reversal operation, the sum remains \(S\).

Your task is to compute and print the minimum and maximum possible sums of the array after the operation. Since the reversal does not alter the sum, both values will be equal to \(S\).

inputFormat

The input is given from stdin:

  1. The first line contains a single integer N representing the size of the array.
  2. The second line contains N space-separated integers representing the elements of the array A.

outputFormat

Output to stdout a single line containing two space-separated integers: the minimum and maximum possible sums of the array after one subarray reversal operation. Both numbers will be identical and equal to \(S = \sum_{i=1}^{N} a_i\).

## sample
4
1 3 2 4
10 10

</p>