#223. 两数条件求和
两数条件求和
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 bWhere and are two integers.
Output Format
Output is printed to standard output in the following format.
resultRepresenting the calculated result.
Sample
1 2
3
3 2
5
2 2
8
Sample Explanation
For sample 1, the input is and . They are not the same, so return their sum . For sample 2, the input is and . They are not the same, so return their sum . For sample 3, the input is and . They are the same, so return double their sum .
Constraints
Time limit: 1s, Memory limit: 1024KiB.