A crate contained some oranges and apples. There are 30 more apples than oranges. 20% of the oranges and 60% of the apples were rotten. The rotten fruits were thrown away. In the end, there were half as many oranges as apples left.

a) How many oranges were there in the crate at first?
b) How many apples were rotten?

a) There were 40 oranges in the crate at first.

b) 36 apples were rotten.