Real numbers $a_1 , a_2 , \dots, a_n$ add up to zero. Find the maximum of $a_1 x_1 + a_2 x_2 + \dots + a_n x_n$ in term of $a_i$'s, when $x_i$'s vary in real numbers such that $(x_1 - x_2)^2 + (x_2 - x_3)^2 + \dots + (x_{n-1} - x_n)^2 \leq 1$. (15 points)
Problem
Source: Iran 3rd round 2013 - Algebra Exam - Problem 2
Tags: inequalities proposed, inequalities