P6824 "EZEC-4" Cola

Background

A long time ago, there was a pigstd who was very obsessed with delicious cola. In order to get tasty cola, he almost spent all his money. He did not even care about his npy (actually because he had no npy), and he also did not like watching shows. Only after buying new cola would he take a carriage out to show off. Every day, every hour, he had to drink a bottle of new cola. Recently, pigstd bought many more cases of new cola—of course, only smart people can drink these colas.

Description

pigstd now has $n$ cases of cola. The $i$-th case is labeled with a positive integer $a_i$. If pigstd's smartness value is a non-negative integer $x$, then for the $i$-th case of cola, if $(a_i \oplus x) \le k$, pigstd can drink this case of cola. Now pigstd tells you $k$ and the sequence $a$. You may choose pigstd's smartness value $x$ so that the number of cola cases he can drink is maximized. Find this maximum value.

Input Format

The first line contains two integers $n$ and $k$, separated by spaces. The next $n$ lines each contain one integer $a_i$, indicating the number labeled on the $i$-th case of cola.

Output Format

Output one positive integer in a single line, indicating the maximum number of cola cases that pigstd can drink.

Explanation/Hint

### Hint **pigstd's smartness value $x$ can be $0$.** ### Sample Explanation Sample 1: It is easy to construct that when $x = 0$, he can drink all colas. Sample 2: It is easy to construct $x = 913$, and he can drink all colas. **The sample explanation is not necessarily the only way.** ### Constraints **This problem uses bundled testdata.** - Subtask 1 (29 points): $1 \le n, k, a_i \le 1000$. - Subtask 2 (1 points): $a_i \le k$. - Subtask 3 (70 points): No special restrictions. For all data, it is guaranteed that $1 \le n, k, a_i \le 10^6$. $\oplus$ denotes XOR. If you do not know what XOR is, please click [here](https://baike.baidu.com/item/%E5%BC%82%E6%88%96/10993677?fr=aladdin). Translated by ChatGPT 5