Determine if it is possible to obtain p numbers of n binary digits, so that any of these two numbers coincide in exactly m positions and there not be a position in which the same digit appears in all the p numbers.
Input Data
Input file nrbinar.in contains seven sets of test data, a set per line. For each data set the values are specified in order p n m, separated by a space.
Output Data
Output file nrbinar.out will contain seven lines, one for each data set in the input file. Line i contains value 1 if for the data set on line i of the input file there is a solution, otherwise it contains a 0.
Restrictions
1 <= p <= 25
1 <= n <= 25
1 <= m <= n
A number may begin with zeroes.
Example
nrbinar.in | nrbinar.out |
5 5 3 |
1 |
Time limit: 1.2 seconds/test
prof. Serban Marinel
"Gr. C. Moisil" Iaşi IT High School
marinel_serban@yahoo.com