Community surplus is the sum of consumer and producer surplus at a given market price and output. Community surplus is maximised in competitive markets at an equilibrium output when price = marginal cost.