You will receive n offers, one at a time, in uniformly random order. All n offers are distinct in quality, but you never see the qualities themselves: when offer i arrives, you learn only its rank among the i offers seen so far (1 = best so far). You must accept or reject each offer on the spot; rejected offers are gone, and you may accept at most one.
You win if the offer you accept is among the m best of all n. If you never accept, you lose.
Choose your strategy. A strategy is a threshold rule: at step i, accept the offer if its rank among the first i is at most t_i, and reject otherwise.
One line with the integers n and m.
n integers t_1, ..., t_n with 0 <= t_i <= i (t_i = 0 means never accept at step i).
Your score is P / P*, where P is the exact probability that your strategy wins and P* is the best achievable probability.
1 <= m <= 10
m <= n <= 200
10 1
0 0 0 0 1 1 1 1 1 1
12 3
0 0 0 0 2 2 2 2 2 2 2 2