To find The largest number of gift bags that can be packed, you will need to find the biggest way all three of these numbers can be divided evenly. You can find this answer by finding the greatest common factor.
I will show this by listing the prime factorization's for each number, and then we will look for all the common factors.
171 = 3 x 3 x 19 63 = 3 x 3 x 7 27 = 3 x 3 x 3
All three lists share two 3s. The means that the biggest way they could be divided is into nine bags (3 x 3).