Easy-to-Solve Expressions
Time limit1sMemory limit1024 MB
Given three distinct integers, the task is to check whether one is the sum or the product of the other two, printing 1, 2, or 3.
- Level
Easy1 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
People often wonder whether a set of numbers has a relationship among them. This task is easier when there are only three numbers.
You are given three distinct positive integers. If one of the three numbers is the sum of the other two, print 1. If one of them is the product of the other two, print 2. Otherwise, print 3. Exactly one of these three messages applies.
Input
There is one input line containing three distinct positive integers. Each integer is between 2 and 1000, inclusive.
Output
Print the message described above.