#2327. 异或求和函数的最大值

异或求和函数的最大值

Background

Special for beginners, ^_^

Description

nn 个数 x1,x2xnx_1,x_2……x_n 和一个数 kk\oplus表示按位异或。对于 $0\leq x\leq k ,f(x)=(x \oplus a_1)+(x \oplus a_2)……(x \oplus a_n)$。求 f(x)f(x) 的最大值。

Format

Input

第一行两个数 n105n(\le10^5)kk

第二行 nn 个用空格隔开的整数 x1,x2xnx_1,x_2……x_n

所有输入都是不超过 101210^{12} 的整数。

Output

一行一个数表示答案。

Samples

6 7
1 1 4 5 1 4
28

Limitation

1s, 1024KiB for each test case.