Two Numbers

Ben has 2 numbers. He tells sum of the numbers to the person S and product of those numbers to P.Now there is this conversation between S and P.


S: I don’t know what the numbers are

P: Neither do I

S: Now, I know what the numbers are.

P: Hey, me too. 

Assuming S and P to be very wise and good in mathematics, What are those two numbers?
If the numbers are x and y, Output 5*x + y.

Note :

  • Numbers are greater than 0.
  • S and P are always truthful.
  • If the numbers are x and y, whats 5 * x + y.
Hints
  • Complete Solution
2403 successful submissions.
Click here to jump start your coding interview preparation