First solving backwards, you have a money worth of 10 left. You gave 20 to your cousin, which will result that you have a value of 30 after you have bought an apple. Then an apple costs 50, therefore before buying that apple you have 80. Hope this helps =)