This post is a sequel to: [Collaboration or acknowledgment?][1] 

The following has come to my attention. A senior mathematician (let us call him Alice) suggested a problem to a young mathematician (Bob) who proceeded to solve it on his own and wrote up the result. The senior mathematician also signed the paper and included his PhD student (Charlie) as a coauthor because they were thinking about the same problem, despite the fact they (Alice and Charlie) did not even have partial results. Is there a way for the young mathematician (Bob) to manage such a situation without creating conflict?  

**Edit:** Bob had no problem with Alice joining him as a coauthor for the reasons mentioned by Igor Rivin below. Thus, rather than stealing credit, the credit was unfairly diluted by including Charlie who had not contributed. Igor Rivin also mentioned that this is not a new phenomenon, which I am surprised to hear.

**Edit:** One good advice so far is to be generous. It does reward unethical behaviour but I have no better advice for the young mathematician, which is why I asked this question.

  [1]: https://mathoverflow.net/questions/191507/collaboration-or-acknowledgment