#120. 条件求和

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

条件求和

Special Sum

Background

Dawei is teaching Congcong basic arithmetic operations. To make it more interesting, Dawei gave Congcong a special sum problem.

Problem Description

Given two integers aa and bb, return their sum. However, if the sum is in the range 1010 to 1919 (inclusive), the actual sum is forbidden. In that case, return 2020. Otherwise, return the actual sum.

Input Format

Input is given from Standard Input in the following format.

Two integers aa and bb, separated by a space.

Output Format

Output to Standard Output in the following format.

An integer representing the sum calculated according to the rules.

Sample

3 4
7
9 4
20
10 11
21

Sample Explanation

  • Sample 1: 3+4=73 + 4 = 7. Since 77 is not in the range 1010 to 1919, return 77.
  • Sample 2: 9+4=139 + 4 = 13. Since 1313 is in the range 1010 to 1919, return 2020.
  • Sample 3: 10+11=2110 + 11 = 21. Since 2121 is not in the range 1010 to 1919, return 2121.

Constraints

For all test cases: 0a,b1000 \le a, b \le 100 Time limit: 1s Memory limit: 1024KB