You are given a set \(S\) consisting of \(n+1\) non-negative integers, \(S = {0, 1, ..., n }\). Also, you have \(k\) unlucky integers \(x_1, x_2, \dots x_k.\)
Let's denote the \(X\)- misfortune of the set \(S\), \(f(S, X)\) --- the number of pairs of integers \((a, b)\) such that \( a + b = X, a \ne b\) and \( a \in S, b \in S\). RedDreamer has to paint each element of \(S\) into one of two colors, white and black, and then create two sets \(c\) and \(d\) so that all white elements belong to \(c\), and all the black elements belong to \(d\) (it is possible that one of these two sets becomes empty). RedDreamer wants to paint the elements in such a way that \(\sum_{i=1}^{k} |f(c, x_i) - f(d, x_i)|\) is minimum possible.
Help RedDreamer to paint the set optimally!
Input format
Note: The sum of \(n\) test cases does not exceed \(10^5 \).
Output format
Let's look to the the 2-test case:
\(c = {0, 1, 3, 4, 8}; d = {2, 5, 6, 7, 9, 10}.\)
f(c, 7) = 1 (4 and 3). f(d, 7) = 1(2 and 5).
f(c, 8) = 1 (0 and 8). f(d, 8) = 1(2 and 6).
f(c, 9) = 1 (1 and 8). f(d, 8) = 1(2 and 7).
\(f(c, 10) = 0; f(d, 10) = 0.\)
\(\sum_{i=1}^{k} |f(c, x_i) - f(d, x_i)| = |1 - 1| + |1 - 1| + |1 - 1| + |0 - 0| = 0.\)