With 37 mangoes you can bake 12 fruit tarts, because you need 3 mangoes for each tarts and you'll use [tex]12\cdot 3 = 36[/tex] mangoes. The remaining mango is not enough for another tart.
On the other hand, in order to bake 12 tarts, you'll need 24 apples, because you need 2 apples per tart.
So, with 12 apples and 37 mangoes you can bake 12 tart, with one mango as leftover.