UTS Open '18 P1 - Love Triangle

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Problem type

The sum, absolute difference, and product of two numbers N and M are all involved in a very messy love triangle. Unfortunately for them, Numberland is a strictly monogamous society and they must determine which two of them will end up together.

In keeping with the principle "the nail that sticks out gets hammered down", they have decided to frame the greatest number for murder so that they can use its wealth to fund the honeymoon of the other two. However, they are currently not sure which one of them this is.

Please help them determine which of them is the largest and save them from their horrible conundrum!

Input Format

-10^9 \le N,M \le 10^9

Output Format:

Output the largest value between the sum, difference, and product.

Sample Input

5 3

Sample Output


Explanation for Sample Output

The sum is 8, the difference is 2, and the product is 15. 15 is the largest of these three numbers.


There are no comments at the moment.