8. Let $S=\left\{r_{1}, r_{2}, \cdots, r_{n}\right\} \subseteq\{1,2,3, \cdots, 50\}$, and any two numbers in $S$ do not sum to a multiple of 7, find the maximum value of $n$.


8. Divide $F=\{1,2, \cdots, 50\}$ into 7 subsets:
$F_{i}=\{K \mid K \equiv i(\bmod 7), K \in F\}, i=0,1,2,3,4,5,6$. Then $S$ can contain at most one element from $F_{0}$, but if $S$ contains some elements from any of the sets $F_{1}, F_{2}, \cdots, F_{6}$, then $S$ can contain all elements of that set, but $S$ cannot simultaneously contain elements from $F_{1}$ and $F_{6}$, or $F_{2}$ and $F_{5}$, or $F_{3}$ and $F_{4}$. Since $F_{1}$ contains 8 elements, and each of the other sets $F_{i}(1 \leqslant i \leqslant 6)$ contains 7 elements, the largest $S$ contains $1+8+7+7=23$ elements.