Answer: 7 bags
Step-by-step explanation:
Total no. of oranges rotten - 12
To buy no. of bags to get - at least 40 good oranges
No. of oranges in a bag - 8
40 + 12 = 52 oranges
As each bag contains 8 oranges and 52 is not divisible by 8 we end up taking the closest divisible number that is 54.
If we divide 54 by 8 we get 7.
Hence Max needs to buy 7 bags of oranges.
Note: As they have asked at least 40 good oranges