@mc2147,
Let x be the unit price of protein in cents per gram.
Let y be the unit price of carbs in cents per gram.
The info you have translates to:
600 = 12x + 6y
500 = 5x + 15y
Solve for x and y.
(Note: I am assuming here that the food item price is purely a linear function of grams of protein and grams of carbohydrate. In real life, that assumption is nonsense.)