Q: A doctor's prescription calls for a daily intake containing 40 mg of vitamin C and 30 mg of vitamin D. Your pharmacy stocks two liquids that can be used: one contains 20% vitamin C and 30% vitamin D, the other 40% vitamin C and 20% vitamin D. How many milligrams of each compound should be mixed to fill the prescription?

The system I came up with is

.2C+.3D=40

.4C+.2D=30, which means we need 75 mg of C and 50 mg of D.

The book says the solution is 50 mg of C and 75 mg of D. Simply switching the outputs from equation 1 and 2 doesn't change anything. Moreover, I am not entirely sure I am seeing the problem correctly. Can anyone explain?

Thanks