#P6824. Maximizing Drank Coke Boxes
Maximizing Drank Coke Boxes
Maximizing Drank Coke Boxes
pigstd has n boxes of coke. The i-th box is labeled with a positive integer \(a_i\). pigstd's cleverness value is a non-negative integer \(x\). For each box, if \(a_i \oplus x \le k\), then pigstd can drink from that box. You are given \(k\) and the sequence \(a\). Determine the maximum number of boxes pigstd can drink from by choosing an appropriate \(x\).
inputFormat
The first line contains two integers \(n\) and \(k\). The second line contains \(n\) positive integers \(a_1, a_2, \dots, a_n\), separated by spaces.
outputFormat
Output a single integer representing the maximum number of boxes pigstd can drink from.
sample
3 2
1 2 3
3