Let the person has x Rs , then price of 50 oranges or 40 mangoes is x Rs.
Therefore, from given information x = (x / 10) + (x / 2) + Amount left.
Hence, the amount left to buy oranges is (2x / 5) , since price of 50 oranges or 40 mangoes is x Rs , hence price of 1 orange, 1 mango is (x / 50), (x / 40) respectively.
Hence, he can buy (2 /5) x 50 = 20 oranges.
Option D is the Correct Answer.