The answer is
\begin{cases}
\frac{n^2}{4} \times 34 & \text{if $n$ is even}; \\
\frac{n^2 - 1}{4} \times 34 & \text{if $n$ is odd}. \tag{$*$}
\end{cases}
In words, when $n$ is even, we need to put $\frac{n}{2}$ points at $x = 1$ and put the remaining $\frac{n}{2}$ points at $35$. When $n$ is odd, we put
$\frac{n + 1}{2}$ points at $x = 1$ and put the remaining $\frac{n - 1}{2}$ points at $35$. This placement gives the above answer.
To argue why such arrangement is optimal, proceed sequentially. Our goal is to place $\{x_1, \ldots, x_n\}$ so that the sum of distances between to distinct points $S_n$ are maximized. We first need to place $x_1$ and $x_2$ to maximize $|x_1 - x_2|$, clearly, we need to set $x_1 = 1$ and $x_2 = 35$ (or exchange their positions). Now we need to arrange $x_3$, we found that no matter where we place it, it gives the same value of $|x_1 - x_2| + |x_3 - x_1| + |x_3 - x_2| = 34 \times 2$. However, if $n > 3$, we have to put $x_3$ at one of the end points. To see this, the contribution of the newly added point $x_4$ to $S_n$ only depends on $|x_4 - x_3|$, which can be inflated if $x_3 \in (1, 35)$. Therefore, we have to put $x_3$ at one of the end point, and put $x_4$ to another end point to maximize $\sum_{1 \leq i < j \leq 4} |x_i - x_j|$. The procedure can be continued in this manner until we finished placing all $n$ points.
Notice that during the procedure described above, every movement has to be fixed (except for when $n$ is odd, you can put the last point $x_n$ anywhere in $[1, 35]$), that is, you must follow this arrangement (i.e, sequentially put points to opposite end points one after one) to achieve the optimal value. Otherwise, the value of the objective function is always possible to be improved, just as I argued why $x_3$ must be put at one end point.