@brokencdplayer,
Let's look at the problem directly.
1) Each 8mg package was repackaged into two smaller doses.
A + B = 8
2) The hospital then used 17 doses of packet A and 14 doses of packet B in one week. The hospital used a total of 127 milligrams of the medicine during that week.
17A + 14B = 127
Do you see how I got those two equations?