A company distributes college logo sweatshirts and sells them for $40 each. The total cost function is linear, and the total cost for 90 sweatshirts is $2970, whereas the total cost for 280 sweatshirts is $6580. Write the equation for the total cost function C(x).