#145. 彩票得分计算

    ID: 145 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatLogic-1gesp1条件结构数学基础

彩票得分计算

Lottery Ticket Score Calculation

Background

Congcong received a special lottery ticket.

Problem Description

You have a blue lottery ticket, with integers a,b,a, b, and cc on it. This makes three pairs, which we'll call abab, bcbc, and acac. Consider the sum of the numbers in each pair.

  • If any pair sums to exactly 1010, the result is 1010.
  • Otherwise, if the abab sum (a+ba+b) is exactly 1010 more than either the bcbc sum (b+cb+c) or the acac sum (a+ca+c), the result is 55.
  • Otherwise, the result is 00.

Input Format

Input is given from standard input in the following format.

aa bb cc

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

a=9,b=1,c=0a=9, b=1, c=0. a+b=9+1=10a+b = 9+1 = 10. Since the abab pair sums to 1010, the result is 1010.

9 2 0
0

Sample Explanation

a=9,b=2,c=0a=9, b=2, c=0. a+b=11a+b = 11, b+c=2b+c = 2, a+c=9a+c = 9. No pair sums to 1010. a+b=11a+b=11 is not exactly 1010 more than b+c=2b+c=2 (112=91011-2=9 \neq 10), nor is it exactly 1010 more than a+c=9a+c=9 (119=21011-9=2 \neq 10). So the result is 00.

6 1 4
10

Sample Explanation

a=6,b=1,c=4a=6, b=1, c=4. b+c=1+4=5b+c = 1+4 = 5. a+c=6+4=10a+c = 6+4 = 10. Since the acac pair sums to 1010, the result is 1010.

Constraints

  • 0a,b,c1000 \le a, b, c \le 100
  • Time limit: 1 second
  • Memory limit: 1024KB