An Alberta-based NHL team is struggling to fill its seats. When the average ticket price is $250, the team sells an average of 8000 tickets. However, when the average price is reduced to $170, the team sells an average of 14400 tickets. The relation of sold tickets q(x) as a function of their average price x is assumed to be linear. Find the function g(x). What should the average ticket price be in order to maximize revenue?