No guarantee that there will enough hotdogs for the buns, we must find the common multiple between the usual number of hot dogs and buns in each package.
Since we're looking for the smallest common multiple between 8 and 10, we can use the method shown below to compute for the least common multiple.
8 = 2³
10 = 2 x 5
LCM = 2³ x 5 = 40
To purchase 40 hot dogs and buns, you need to buy 5 packages of buns and 4 packages of hot dogs.
Answer:
Hotdog: 4 packages
Buns: 5 packages