Simple Monotony
Suppose there is a Boolean function defined on a set of Boolean vectors, each with a dimension of K. One vector is said to precede another if they differ and each coordinate of the first vector is not greater than the corresponding coordinate of the second vector. A function is considered monotonic if its value on each vector is not less than its value on any preceding vector. Your task is to modify the function values on the minimum number of vectors to make the function monotonic.
Input
The input starts with two integers, N and K (1 ≤ N ≤ 1000, 1 ≤ K ≤ 10), representing the number of vectors and their dimension, respectively. This is followed by N lines, each containing K+1 numbers: a Boolean vector and the function value for that vector. All numbers are either 0 or 1, and all vectors are distinct.
Output
The output should consist of two lines. The first line should contain the minimum number of vectors whose function values need to be changed to achieve monotonicity. The second line should list the indices of these vectors, without repetition and in any order.