An airline charges 380 dollar for a round-trip flight from New York to Los Angeles if the ticket is purchased at least 7 days in advance of travel. Otherwise, the price is 700 dollar . If a total of 80 tickets are purchased at a total cost of 39,040 dollar, find the number of tickets sold at each price.