n = read_line.to_i a = read_line.split.map &.to_i m = read_line.to_i.pred ave = a.sum / n val1 = a.map { |i| (i - ave).abs ** 2 } val2 = Math.sqrt(val1.sum / n) if val2 != 0 val3 = (ave - a[m]).abs * 10 / val2 puts (ave < a[m] ? 50 + val3 : 50 - val3).trunc.to_i else puts 50 end