5. Let $S=\left\{a_{1}, a_{2}, \cdots, a_{\mathrm{r}}\right\}$ be a set of integers, where $r>1$. For a non-empty subset $A$ of $S$, define $p(A)$ as the product of all integers in $A$. Let $m(S)$ denote the arithmetic mean of $p(A)$, where $A$ ranges over all non-empty subsets of $S$.

If $m(S)=13$, and there exists a positive integer $a_{\mathrm{r}+1}$ such that $m\left(S \cup\left\{a_{t+1}\right\}\right)=49$, determine the values of $a_{1}, a_{2}, \cdots, a_{r}$ and $a_{\mathrm{r}+1}$.
$$
\begin{array}{l}
5. \text{ For any natural number } n \text{ and } A=\left\{a_{1}, a_{2},\right. \\
\left.\cdots, a_{n}\right\}, \text{ since } \\
\quad a_{1}+a_{2}+\cdots+a_{n}+\left(a_{1} a_{2}+\cdots+a_{1} a_{n}+\right. \\
\left.\cdots+a_{n-1} a_{n}\right)+\cdots+a_{1} a_{2} \cdots a_{n} \\
=\left(1+a_{1}\right)\left(1+a_{2}\right) \cdots\left(1+a_{n}\right)-1
\end{array}
$$

and the number of all non-empty subsets of $A$ is $2^{a}-1$, we get
$$
m(A)=\frac{\left(1+a_{1}\right) \cdots\left(1+a_{n}\right)-1}{2^{n}-1},
$$

which means
$$
\begin{array}{l}
\left(1+a_{1}\right)\left(1+a_{2}\right) \cdots\left(1+a_{n}\right) \\
=m(A)\left(2^{n}-1\right)+1 .
\end{array}
$$

From this equation, we can derive
$$
\begin{array}{l}
\left(2^{\mathrm{r}+1}-1\right) m\left(S \cup\left\{a_{\mathrm{r}+1}\right\}\right)+1 \\
=\left(1+a_{1}\right) \cdots\left(1+a_{\mathrm{r}}\right)\left(1+a_{\mathrm{r}+1}\right) \\
=\left[m(S)\left(2^{\mathrm{r}}-1\right)+1\right]\left(1+a_{\mathrm{r}+1}\right) .
\end{array}
$$

Substituting the given conditions $m(S)=13$,
$m\left(S \cup\left\{a_{r+1}\right\}\right)=49$, we get
$$
\begin{array}{c}
49\left(2^{\mathrm{r}+1}-1\right)+1=\left(1+a_{\mathrm{r}+1}\right) \\
\cdot\left[13\left(2^{\mathrm{r}}-1\right)+1\right] .
\end{array}
$$

From this, we solve
$$
2^{\mathrm{r}}=\frac{12\left(a_{\mathrm{r}+1}-3\right)}{13 a_{\mathrm{r}+1}-85} .
$$

Note: (1) The right-hand side of the equation is a monotonically decreasing function of $a_{\mathrm{r}+1}$: its graph consists of two branches, both of which are decreasing curves in the intervals $\left(-\infty, \frac{85}{13}\right)$ and $\left(\frac{85}{13}\right.$, $+\infty)$. When $a_{\mathrm{r}+1}=1$, the right-hand side of (1) equals $\frac{24}{72}=\frac{1}{3}$.

Thus, for $y_{\mathrm{r}+1}=1,2, \cdots, 6$, the right-hand side of (1) is less than 1; hence, we only need to consider $a_{\mathrm{r}+1} \geqslant 7$. However, when the positive integer $a_{r+1} \geqslant 8$, the right-hand side of (1) is not an integer. Therefore, the only possible value is $a_{\mathrm{r}+1}=7$, and from (1) we get
$$
2^{r}=\frac{12 \times 4}{91-85}=8,
$$

so $r=3$. This leads to
$$
\begin{array}{l}
\left(1+a_{1}\right)\left(1+a_{2}\right)\left(1+a_{3}\right)=\left(2^{3}-1\right) \\
\cdot m(S)+1=7 \times 13+1=92 .
\end{array}
$$

Thus,
$$
\left(1+a_{1}\right)\left(1+a_{2}\right)\left(1+a_{3}\right)=2 \times 2 \times 23 .
$$

Therefore, the unique positive integer solution is
$$
1+a_{1}=2,1+a_{2}=2,1+a_{3}=23,
$$

which means
$$
a_{1}=1, a_{2}=1, a_{3}=22 .
$$

There are also 15 other integer solutions, which the reader is encouraged to find.