  We consider the problem of fairly and efficiently allocating indivisible
items (goods or bads) under capacity constraints. In this setting, we are given
a set of categorized items. Each category has a capacity constraint (the same
for all agents), that is an upper bound on the number of items an agent can
receive from each category. Our main result is a polynomial-time algorithm that
solves the problem for two agents with additive utilities over the items. When
each category contains items that are all goods (positively evaluated) or all
chores (negatively evaluated) for each of the agents, our algorithm finds a
feasible allocation of the items, which is both Pareto-optimal and envy-free up
to one item. In the general case, when each item can be a good or a chore
arbitrarily, our algorithm finds an allocation that is Pareto-optimal and
envy-free up to one good and one chore.
