#abc167b. [abc167_b]Easy Linear Programming
[abc167_b]Easy Linear Programming
Problem Statement
We have cards, each of which has an integer written on it. Similarly, we also have cards with s and cards with s.
We will pick up among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the maximum possible sum of the numbers written on the cards chosen.
Sample Input 1
2 1 1 3
Sample Output 1
2
Consider picking up two cards with s and one card with a . In this case, the sum of the numbers written on the cards is , which is the maximum possible value.
Sample Input 2
1 2 3 4
Sample Output 2
0
Sample Input 3
2000000000 0 0 2000000000
Sample Output 3
2000000000