Answer:
number of pens in each bag: 19
number of pencils in each bag: 7
number of erasers in each bag: 3
Explanation:
To find how many pens, pencils and erasers Huxian needs to put in each gift bag, we need to calculate the greatest common divisor (gcd) of 171, 63 and 27. We can do that decomposing each number in their prime divisors, and then we multiply the common values:
decomposing 171: 3*3*19
decomposing 63: 3*3*7
decomposing 27: 3*3*3
The common values are 3 and 3, and the product of these values indicate the number of bags that will be formed:
number of bags = 3*3 = 9
Then, the remaining values of each one will be the number of each element put into each bag:
number of pens in each bag: 19
number of pencils in each bag: 7
number of erasers in each bag: 3