#SDNU1305. Hamming Codes
Hamming Codes
Description
Given , , and : Find a set of codewords (), each of length bits (), such that each of the codewords is at least Hamming distance of () away from each of the other codewords. The Hamming distance between a pair of codewords is the number of binary bits that differ in their binary notation. Consider the two codewords 0x554 and 0x234 and their differences (0x554 means the hexadecimal number with hex digits , , and ):
0x554 = 0101 0101 0100
0x234 = 0010 0011 0100
Bit differences: xxx xx
Since five bits were different, the Hamming distance is .
Format
Input
, , on a single line
Output
codewords, sorted, in decimal, ten per line. In the case of multiple solutions, your program should output the solution which, if interpreted as a base integer, would have the least value.
Samples
16 7 3
0 7 25 30 42 45 51 52 75 76
82 85 97 102 120 127