#C9447. Maximum Sum After Removal
Maximum Sum After Removal
Maximum Sum After Removal
Given a sequence of integers, your task is to remove exactly one element from the sequence such that the sum of the remaining elements is maximized.
Formally, if you have a list of integers \(a_1, a_2, \dots, a_n\), you want to maximize the sum \[ S = \sum_{i=1}^{n} a_i - x, \] where \(x\) is the element that you remove. You are guaranteed that the list contains at least two elements.
Output the maximum sum after removing one integer from the input list.
inputFormat
The input is given via standard input (stdin) as a single line containing at least two integers separated by whitespace.
outputFormat
Output a single integer to standard output (stdout) representing the maximum possible sum after removing exactly one element.
## sample4 2 -3 6 7
19