We have to find the highest common factor here in order to find the maximum height of the stacks.
Factors of 24 = 1, 2, 3, 4, 6, 8 , 12 and 24.
Factors of 16 =1, 2, 4, 8 and 16.
So, 8 is the highest common factor here.
Maximum number of juice cans in a stack will be 8 cans.