First you do 5x20=100 then you need to find out what is the closes thing to 217 so you do 3x40=120 then you subtract 3 from 120 to get 117. Then you take that 20 pictures and the 39 from the 40 then subtracting 1 then do 20+39=59. Which means they sold 59 tickets
First you would multiple 5 × 20 which equals $100 then you would subtract $217 by $100 and you would get 39 tickets and then you would add your twenties tickets and your 39 tickets together to get your answer which is 59 tickets.