Since patient A gets three times more, 50 times 3 is 150. 150 plus 50 is 200, therefore, patient A gets 150 mg and patient B gets 50 mg. I hope this helps :)
As you can see this figure is a rectangular prism. Two sides are squares. When the figure is cut facing the squares, the resulting shape will be a square.