I like your questions, they are simple and yet challenging at the same time. If we had numbers this question would be simple, but to think of it in only variables is...enlightening. Let me give this a try, check my work Aryth

The total amount of money invested is x + y + y = x + 2y dollars.

Mr. A invested x dollars, so by proportion, the amount of money he invested is x/(x + 2y), so he should get x/(x + 2y) of the profit, which in this case is 100*[x/(x + 2y)] = 100x/(x + 2y) dollars