Below is an instruction that describes a task. Write a response that appropriately completes the request in Swahili. Please answer in Swahili.

### Instruction:
There are 42 apples in a crate. 12 crates of apples were delivered to a factory. 4 apples were rotten and had to be thrown away. The remaining apples were packed into boxes that could fit 10 apples each. How many boxes of apples were there?

### Response:
 Jumla ya matofaa yaliyosafirishwa ilikuwa 42 × 12 = <<42*12=504>>504.
Idadi ya matofaa yaliyosalia baada ya kutupa yale yaliyooza ilikuwa 504 - 4 = <<504-4=500>>500.
Idadi ya matofaa ambayo yanaweza kuingia kwenye sanduku moja ni 10, hivyo kulikuwa na masanduku 500 ÷ 10 = <<500/10=50>>50 ya matofaa.