this one is relatively straight forward with this type of problems. I just spent an evening and more to solve a similar but much more complicated problem:
2 numbers a and b, a >=b, both integers between 2 and 99. Mr. P knows the sum S=a+b, and Mr. Q knows the product M=a*b. Here is the conversation:
Q: I don't know what are a and b.
P: I know you don't know, and I don't know either.
Q: I know now.
P: I also know now.
What are a and b?