Answer:
6 pens
2 pencils
1 eraser in each gift bag
Most number of Gift Bags = 27.
Explanation:
There will be some bags left over. The limiting factor is the erasers. At most, you can have 27 erasers and therefore 27 gift bags.
171 pens: 171/27 = 6 (you have to round down). The number of pens left over is 9.
(27*6 = 162)
171 - 162 = 9
63 Pencils: 63/27 = 2 pencils per gift bag. There will be
63 - 2*27
63 - 54
9 pencils will be left over.