loop do
  n, k = gets.split.map(&:to_i)
  break if n == 0
  ca = n.times.map{ gets.to_i }
  cm = ca.each_cons(k).map{ |cards| cards.reduce(:*) }
  cs = ca.sort.reverse
  ci = ca.map{ |card| cs.index(card) }
  v = cm.max
  ans = 0
  (0..n-k).each do |i|
    min = cs[ci[i,k].max]
    max = cs[((0...n).to_a - ci[i,k]).min]
    ans = cm[i] * max / min - v if ans < cm[i] * max / min - v
  end
  puts ans
end