Four, (50 points) Given that $A$ is a set composed of 2015 different positive integers, and any three different numbers in $A$ form the side lengths of a non-obtuse triangle, at which point the triangle is called a triangle determined by the set $A$. $S(A)$ represents the sum of the perimeters of all triangles determined by $A$ (congruent triangles are counted only once). Find the minimum value of $S(A)$.

---

Please note that the translation preserves the original text's line breaks and formatting.
$$
\begin{array}{l}
\text { When the set } A \text { is given, } S(A) \text { is uniquely determined. Therefore, to make } S(A) \text { as small as possible, the elements in set } A \text { must be as small as possible. } \\
\text { Let } A=\left\{a_{1}, a_{2}, \cdots, a_{2015}\right\}, a_{1}47265625=6875^{2} \geqslant a_{k}^{2},
\end{array}
$$

that is, any three different numbers in set $A_{0}$ can be the lengths of the sides of a non-obtuse triangle.
$$
\begin{array}{l}
=\mathrm{C}_{2014}^{2} \cdot \frac{2015(4861+6875)}{2} \\
=11824020 \mathrm{C}_{2014}^{2} \text {. } \\
\end{array}
$$