250 people go to an amusement park. They buy t-shirts and baseball caps. Each t-shirt costs $8. Each cap costs $5. They spent $1700. How many each t-shirts and caps did they buy?

250 people, out of which t people bought t-shirts, and (250-t) bought caps.

Form the following equation:
8t+5(250-t)=1700

Solve for t.