Assume we are given a set of weights, $x_1$ of which have mass $d_1$, $x_2$ have mass $d_2$, etc, $x_k$ have mass $d_k$, where $x_i,d_i$ are positive integers and $1\le d_1<d_2<\ldots<d_k$. Let us denote their total sum by $n=x_1d_1+\ldots+x_kd_k$. We call such a set of weights [i]perfect[/i] if each mass $0,1,\ldots,n$ can be uniquely obtained using these weights.

(a) Write down all sets of weights of total mass $5$. Which of them are perfect?
(b) Show that a perfect set of weights satisfies $$(1+x_1)(1+x_2)\cdots(1+x_k)=n+1.$$
(c) Conversely, if $(1+x_1)(1+x_2)\cdots(1+x_k)=n+1$, prove that one can uniquely choose the corresponding masses $d_1,d_2,\ldots,d_k$ with $1\le d_1<\ldots<d_k$ in order for the obtained set of weights is perfect.
(d) Determine all perfect sets of weights of total mass $1993$.
### Part (a)
1. List all sets of weights of total mass \(5\):
   - \(\{1, 1, 1, 1, 1\}\)
   - \(\{1, 1, 1, 2\}\)
   - \(\{1, 2, 2\}\)
   - \(\{1, 1, 3\}\)
   - \(\{2, 3\}\)
   - \(\{1, 4\}\)
   - \(\{5\}\)

2. Determine which sets are perfect:
   - A set of weights is perfect if each mass \(0, 1, \ldots, 5\) can be uniquely obtained using these weights.
   - \(\{1, 1, 1, 1, 1\}\): Perfect, as each mass from \(0\) to \(5\) can be uniquely obtained.
   - \(\{1, 1, 1, 2\}\): Not perfect, as some masses can be obtained in multiple ways.
   - \(\{1, 2, 2\}\): Perfect, as each mass from \(0\) to \(5\) can be uniquely obtained.
   - \(\{1, 1, 3\}\): Perfect, as each mass from \(0\) to \(5\) can be uniquely obtained.
   - \(\{2, 3\}\): Not perfect, as some masses cannot be obtained.
   - \(\{1, 4\}\): Not perfect, as some masses cannot be obtained.
   - \(\{5\}\): Not perfect, as some masses cannot be obtained.

The final answer is \( \boxed{ \{1, 1, 1, \ldots, 1\}, \{1, 2, 2, \ldots, 2\}, \{1, 1, 1, \ldots, 1, 997\} } \)