#145. 彩票得分计算
彩票得分计算
Lottery Ticket Score Calculation
Background
Congcong received a special lottery ticket.
Problem Description
You have a blue lottery ticket, with integers and on it. This makes three pairs, which we'll call , , and . Consider the sum of the numbers in each pair.
- If any pair sums to exactly , the result is .
- Otherwise, if the sum () is exactly more than either the sum () or the sum (), the result is .
- Otherwise, the result is .
Input Format
Input is given from standard input in the following format.
Output Format
Output is printed to standard output in the following format.
An integer representing the calculated score.
Sample
9 1 0
10
Sample Explanation
. . Since the pair sums to , the result is .
9 2 0
0
Sample Explanation
. , , . No pair sums to . is not exactly more than (), nor is it exactly more than (). So the result is .
6 1 4
10
Sample Explanation
. . . Since the pair sums to , the result is .
Constraints
- Time limit: 1 second
- Memory limit: 1024KB