A mixture contains ingredient A costing $5 per gram, ingredient B costing $12 per gram, and ingredient C costing $8 per gram. A batch of the mixture costs a total of $300. If the batch contains grams of A, grams of B, and grams of C, which of the following expresses in terms of and ?