n, s, w_id = gets.strip.split(' ').map(&:to_i) a = gets.strip.split(' ').map(&:to_i) scores = [] (1..n - 1).each do |i| scores << (50 * s + 50 * s / (0.8 + 0.2 * i)).floor end score_writer = a[w_id] + 100 * s pro = 1.0 (0...n).each do |id| next if id == w_id count = 0 scores.each do |score| if a[id] + score > score_writer count += 1 else break end end pro *= (1.0 - count.to_f / (n - 1)) end p pro