Question 8
Let $S=\{a_{1}, a_{2}, \ldots, a_{r}\}$ denote a sequence of integers. For each non-empty subsequence $A$ of $S$, we define $p(A)$ to be the product of all the integers in $A$. Let $m(S)$ be the arithmetic average of $p(A)$ over all non-empty subsets $A$ of $S$. If $m(S)=13$ and if $m\left(S \cup\{a_{r+1}\}\right)=49$ for some positive integer $a_{r+1}$, determine the values of $a_{1}, a_{2}, \ldots, a_{r}$ and $a_{r+1}$.