#223. 两数条件求和

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

两数条件求和

Sum or Double Sum

Background

Dawei is teaching basic programming.

Problem Description

Given two integer values, return their sum. Unless the two values are the same, then return double their sum.

Input Format

Input is given from standard input in the following format.

a b Where aa and bb are two integers.

Output Format

Output is printed to standard output in the following format.

result Representing the calculated result.

Sample

1 2
3
3 2
5
2 2
8

Sample Explanation

For sample 1, the input is 11 and 22. They are not the same, so return their sum 1+2=31+2=3. For sample 2, the input is 33 and 22. They are not the same, so return their sum 3+2=53+2=5. For sample 3, the input is 22 and 22. They are the same, so return double their sum (2+2)×2=8(2+2) \times 2 = 8.

Constraints

Time limit: 1s, Memory limit: 1024KiB.