First let's see how many donuts is each package
That means, for the first school we have 5 pallets,6 cartons, 4 boxes, and 8 individual donuts
the most efficient way to share the donuts is giving 1129 donuts to each class. That could be done by giving 1 pallet and 1 carton to each class, then we have 1 carton,4 boxes, and 8 donuts which means we have 148 left, so we can divide those 148 donuts among 5 and then give 29 donuts to each class.
For the other school, there are 5 cartons, 7 boxes, and 4 donuts.
They need to share approximately 95 donuts per class, but the most efficient way could be to give 1 carton to each class, there are 5 cartons so, there is one class without a carton, and to that class, we can give all the rest donuts which are the 7 boxes and the 4 donuts, in that way 5 classes would have 100 donuts each and one of the classes would have 74 donuts.
Let's do it with the last one, they have: 7 pallets,8 cartons,2 boxes, and 5 donuts
each class would have 652 donuts if we distribute them equally. We can give half a pallet to each class and then we have 1 pallet
8 cartons,2 boxes, and 5 donuts, which is 1825 donuts, we can share them among the 12 classes, so we can give 152 more donuts to each class.