Optimal Capacity Allocation