Supposing that the length of every edge of the convex $n$-gon $P_1P_2$$\cdots$$P_n$ is 1, what is the shape of the $n$-gon which gives the maximum of the following function $A_n$? $$A_n=\sum_{1\le{i}\lt{j}\le{n}}|P_iP_j|^2$$
Here, $|P_iP_j|$ is the Euclidean length of the line segment from $P_i$ to $P_j$.
I've already proved that $A_5$ reaches the maximum only if the pentagon is a regular pentagon, but I don't have any good idea for $n\ge6$. I need your help.