.
I will show you how to solve this problem quickly and mentally.
From the condition, you have this system of 2 equations
x - y = 3 (1)
x^2 + y^2 = 45. (2)
Square equation (1); keep equation (2) as is.
x^2 - 2x + y^2 = 9 (1')
x^2 + y^2 = 45 (2')
Now subtract equation (1') from equation (1'). You will get
2xy = 45 - 9 = 36, or
xy = 36/2 = 18.
Thus you have two numbers x and y with the difference of 3 and the product of 18.
3 seconds is enough to guess (to recognize) these numbers, 3 and 6.
Solved.