The tests for this problem consist of eight groups. Points for each group are awarded only if all tests of the group and all tests of some of the previous groups are passed. Note that passing the tests from the statement is not required for some groups. \textbf{Offline checking} means that the results of testing your solution on this group will only be available after the competition ends.

\begin{center}
\begingroup
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{|c|c|c|c|c|c|c|c|}
\hline
& & \multicolumn{1}{c|}{Constraints} & & \\
\cline{3-3}
\raisebox{2.25ex}[0cm][0cm]{Group}
& \raisebox{2.25ex}[0cm][0cm]{Points}
& $n$
& \raisebox{2.25ex}[0cm][0cm]{\parbox{3cm}{\centering Required}}
& \raisebox{2.25ex}[0cm][0cm]{Comment}
\\
\hline
0 & 0 & -- & -- & Samples \\
\hline
1 & 9 & $n \le 20$ & 0 & \\
\hline
2 & 15 & $n \le 100$ & 0 -- 1 & \\
\hline
3 & 7 & -- & -- & $S \le 1,\ a_i \ge 1$ \\
\hline
4 & 17 & -- & -- & $X = 0$ \\
\hline
5 & 10 & $n \le 2\,000$ & 0 -- 2 & \\
\hline
6 & 21 & -- & -- & All numbers in $a$ are distinct \\
\hline
7 & 11 & $n \le 100\,000$ & 0 -- 2, 5 & \\
\hline
8 & 10 & -- & 0 -- 7 & \textbf{Offline checking} \\
\hline
\end{tabular}
\endgroup
\end{center}