A store owner had coconuts and papayas. The ratio of coconuts to papayas was 5:2. After 1/2 of the coconuts and 18 papayas were sold, there were 2 times as many coconuts as papayas left. How many coconuts and papayas were there at first?

Let initial amount of coconut and papayas be 5x and 2x.

After 1/2 of coconuts sold.
Coconuts remaining = (1 - 1/2) 5x = 5x/2
After 18 papayas sold, papayas remaining = (2x - 18)
But 2(2x - 18) = 5x/2 (given)
=> 8x - 72 = 5x => x = 24
So Initial amount coconuts = 5x = 120 and papayas = 2x = 48