In this problem, there are conditional blocks. If your solution works correctly for certain constraints, it will receive a certain number of points. Note that each test is graded individually.

\begin{enumerate}
\item ($5$ points): $x=1$;
\item ($15$ points): $n\le 1000$;
\item ($15$ points): $a_i\le n$;
\item ($15$ points): $a_1=a_2=\dots=a_n$;
\item ($50$ points): without additional constraints.
\end{enumerate}