A hat manufacturing firm has the following production function with capital and labor being the inputs: Q min(4L, 7K)-that is, it has a fixed-proportions production function. If w is the cost of a unit of labor and r is the cost of a unit of capital, derive the firm's long-run total cost curve and average cost curve in terms of the input prices and Q.