We will make use of the concept of prime factors for solving this question. The prime factors of 1517 are:
So, as can be clearly seen the Niagara Fall tour operator can either sell 37 tickets for $41 each or 41 tickets for $37 each.
Now, we know that we cannot reach $37 using just three bills. Thus, the only option left to us is $41 which can be broken down into three bills of $20,$20 and $1. This satisfies our condition.
Thus the cost of a ticket was $41 and 37 such tickets were sold.