You need to factor 1517, try dividing it by three bill combos to find an integer solution.
combos of 1$, 5$, 10$, 20$, etc.
I tried various combos starting with smallest and found 41 = 20$+20$+1$ to be a factor of 1517.
1517$ / 41$ = 37 tickets
cost of tickets is 41$