3. Given that $a_{1}, a_{2}, \cdots, a_{2002}$ have values of 1 or -1, let $S$ be the sum of the pairwise products of these 2002 numbers.
(1) Find the maximum and minimum values of $S$, and specify the conditions under which these maximum and minimum values can be achieved;
(2) Find the smallest positive value of $S$, and specify the conditions under which this smallest positive value can be achieved.
$$
\begin{array}{l}
\text { 3. (1) }\left(a_{1}+a_{2}+\cdots+a_{200}\right)^{2} \\
=a_{1}^{2}+a_{2}^{2}+\cdots+a_{2002}^{2}+2 m=2002+2 m, \\
m=\frac{\left(a_{1}+a_{2}+\cdots+a_{200}\right)^{2}-2002}{2} .
\end{array}
$$

When $a_{1}=a_{2}=\cdots=a_{200}=1$ or -1, $m$ reaches its maximum value of 2003001.

When $a_{1}, a_{2}, \cdots, a_{2002}$ contain exactly 1001 1s and 1001 -1s, $m$ reaches its minimum value of -1001.
(2) Since the smallest perfect square greater than 2002 is $45^{2}=$ 2025, and $a_{1}+a_{2}+\cdots+a_{20 \mathrm{~m}}$ must be even, therefore, when
$$
a_{1}+a_{2}+\cdots+a_{2002}=46 \text { or }-46 \text {; }
$$

i.e., when $a_{1}, a_{2}, \cdots, a_{2002}$ contain exactly 1024 1s and 978 -1s or exactly 1024 -1s and 978 1s, $m$ reaches its minimum value
$$
\frac{1}{2}\left(46^{2}-2002\right)=57 .
$$