VPEX P1 - War on Two Fronts

View as PDF

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Problem type

Darcy has 2 sets of 5 numbers each. He chooses one of the sets and adds up all the numbers in that set except one. What is the maximum sum of those 4 numbers?

Input Specification

The first line contains 5 integers, with each integer being a number in the first set.

The second line contains 5 integers, with each integer being a number in the second set.

Output Specification

Output the maximum amount of points Darcy can obtain.

Sample Input

5 1 5 5 5
3 3 2 2 2

Sample Output

20

Explanation

Darcy chooses every number in the first set except the number 1.