#include <iostream>
#include <algorithm>
using namespace std;

int main() {

  int n,k;
  while(1) {
    cin >> n >> k;
    if(n == 0 && k == 0) break;

    int a[101] ={};
 
    for(int i=0;i<n;i++) cin >> a[i];

    int ck = -1;
    int site = 0;
    for(int i=0;i<=n-k;i++) {
      int t = 1;
      for(int j=0;j<k;j++) t*= a[j+i];
      if(ck <t) ck = t, site = i;
    }

    int nmin=100000;
    int site2=0;
    for(int i=0;i<k;i++) 
      if(a[site+i] < nmin) nmin = a[site+i],site2 = i+site;


    int amax = a[site2];
    for(int i=0;i<n;i++) {
      if( site <= i && i<=site+k) continue;
      if(amax < a[i]) amax = a[i];
    }
    //  cout << a[site2] << endl;
    //cout << amax <<endl;
    int ck2 = (ck/a[site2])*amax;
    //cout << ck <<" "<<ck2<<endl;
    //if(ck2-ck <= 0 && n-k<2) cout <<"NO GAME"<<endl;
    else cout << ck2-ck <<endl;
  
  }

  return 0;
}