Sheila went to the fair and spent a total of $40. She paid $16 for a ticket to the fair, and she played some games at the fair for $3 each. Which equation could be used to determine the number of games, x, Sheila played?