100 atcoder#ABC167B. [ABC167B] Easy Linear Programming
[ABC167B] Easy Linear Programming
Score : points
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.
2 1 1 3
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.
1 2 3 4
0
2000000000 0 0 2000000000
2000000000