Diskurs
문제
You are given non negative integers less than . For each of them you are to find the maximum possible hamming distance between it and some other element of the array .
The hamming distance of two non negative integers is defined as the number of positions in the binary representation of these numbers in which they differ (we add leading zeros if necessary).
Formally, for each calculate:
입력
The first line contains two integers and (1 ≤ n ≤ 2^m, 1 ≤ m ≤ 20).
The second line contains numbers (0 ≤ a_i < 2^m)
출력
Output numbers seperated with spaces, where the -th number is the maximum hamming distance between and some other number in .
힌트
Clarification of the third example: The numbers , , , can be represented as , , , , in binary. Numbers and differ at places, same as numbers and . On the other hand, the number differs in at most places with all other numbers.
예제
예제 1
4 4 9 12 9 11
2 3 2 3
예제 2
4 4 5 7 3 9
2 3 2 3
예제 3
4 4 3 4 6 10
3 3 2 3