For any finite sequence (x1,…,xn), denote by N(x1,…,xn) the number of ordered index pairs (i,j) for which 1≤i<j≤n and xi=xj. Let p be an odd prime, 1≤n<p, and let a1,a2,…,an and b1,b2,…,bn be arbitrary residue classes modulo p. Prove that there exists a permutation π of the indices 1,2,…,n for which
N(a1+bπ(1),a2+bπ(2),…,an+bπ(n))≤min(N(a1,a2,…,an),N(b1,b2,…,bn)).