#4543. XXOR

XXOR

题目描述

nn 个数 a1,a2,,ana_1,a_2,\dots,a_n 和一个数 kk\oplus 表示按位异或。对于 $0\leq x\leq k,f(x)=(x \oplus a_1)+(x \oplus a_2)……(x \oplus a_n)$。求 fmaxf_{\max} 为多少。

输入格式

一行两个数 n,mn,m,接下来一行 mm 个用空格隔开的整数 x1,x2,,xnx_1,x_2,\dots,x_n

输出格式

一行一个数表示答案。

3 7
1 6 3
14
4 9
7 4 0 3
46
1 0
1000000000000
1000000000000

说明/提示

1n105,0k,ai10121\leq n\leq 10^5,0\leq k,a_i\leq 10^{12}