#C1676. Minimum Sum after Operations
Minimum Sum after Operations
Minimum Sum after Operations
You are given an array of n integers represented as \(A=[a_1, a_2, \dots, a_n]\). In one operation, you can select any two elements and replace them with their sum. This operation is repeated until only one element remains in the array.
Since the operation is simply summing two numbers and replacing them, the final remaining number will always be the sum of all elements in the array.
Your task is to compute and output this final sum.
Note: Although the description mentions operations, the result is invariant and always equals \(\sum_{i=1}^{n} a_i\).
inputFormat
The input is provided via standard input (stdin) and has the following format:
- The first line contains a single integer \(n\) denoting the number of elements in the array.
- The second line contains \(n\) space-separated integers, representing the elements of the array \(A\).
outputFormat
Output a single integer, the sum of all elements of the array.
## sample3
1 2 3
6