Answer:
In a perfectly competitive market, all n firms are equal. Thus, the market total cost is the total cost (TC) of one firm multiplied by the amount of n firms in the market
Total Market Cost = n(TC)
Total cost relates to output because firms want to make a profit.
Profit = TR - TC where TR = total cost and TR = total revenue.
Firms produce at the quantity which MR (marginal revenue) = MC (marginal cost). At this quantity, multiply it by n number of firms in the market to achieve the total output in a market.