Is it a Sum or a Product
CodeChefOpen on judge ↗
Alisha is playing a game with her little brother Ravi who has just learned how to add and multiply numbers. In the game, Alisha gives Ravi two numbers $A$ and $B$, and he needs to find the sum or product of the given numbers. There are two types of queries:- - Type 1: $1$ $A$ $B$ - Ravi needs to find the sum of $A$ and $B$. - Type 2: $2$ $A$ $B$ - Ravi needs to find the product of $A$ and $B$. B
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start