My book says that there is a simple proof to provide the following, but it doesn't give it. Can someone please explain this:

Suppose there is a game in which there are two kinds of scoring events. One event gives a score of m points, and the other gives a score of n points. Assuming that m and n are relatively prime, we can derive a formula for the largest unattainable score and prove that the answer is correct.

Can anyone help derive this formula and prove that its true?