Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	for {
		m, nMin, nMax := nextInt(sc), nextInt(sc), nextInt(sc)
		if m == 0 && nMin == 0 && nMax == 0 {
			break
		}

		score_list := []int{}
		for i := 0; i < m; i++ {
			score_list = append(score_list, nextInt(sc))
		}

		// 最低合格者数と最高合格者数の間の各得点間のギャップが最大になる合格者数を取得する
		scoreGap := 0
		scoreGapMax := 0
		qualifiedNum := 0
		for n := nMin; n <= nMax; n++ {
			scoreGap = score_list[n-1] - score_list[n]
			if scoreGap >= scoreGapMax {
				scoreGapMax = scoreGap
				qualifiedNum = n
			}
		}

		fmt.Println(qualifiedNum)
	}
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

const int INF = (int)1e9;

int main() {
  while(true) {
    int m, nmin, nmax;
    cin >> m >> nmin >> nmax;
    if(m == 0 && nmin == 0 && nmax == 0) break;
    vector<int> p(m);
    for(int i = 0; i < m; ++i) cin >> p[i];
    int ansgap = 0;
    int ansac = -1;
    for(int point = 0; point <= 10000; ++point) {
      int acmin = INF;
      int wamax = 0;
      int numac = 0;
      for(int i = 0; i < m; ++i) {
        if(p[i] >= point) {
          acmin = min(acmin, p[i]);
          numac++;
        }
        else {
          wamax = max(wamax, p[i]);
        }
      }
      if(nmin <= numac && numac <= nmax) {
        if(ansgap < acmin - wamax || (ansgap == acmin - wamax && ansac < numac)) {
          ansgap = acmin - wamax;
          ansac = numac;
        }
      }
    }
    cout << ansac << endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF = 1e9;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

int main()
{
    int M, NA, NB;
    while (cin >> M >> NA >> NB, M || NA || NB) {
        vector<int> P(M);
        rep(i, M) {
            cin >> P[i];
        } 

        int ans = 0, mgap = 0;
        for (int i=NA; i<=NB; i++) {
            int gap = P[i-1] - P[i];
            if (gap >= mgap) {
                ans = i;
                mgap = gap;
            }
        }

        cout << ans << endl;
    }
}

C++: #include <iostream>
using namespace std;

int main(){
  int m,mini,maxi;
  while(1){
    cin>>m>>mini>>maxi;
    if(m==0&&mini==0&&maxi==0)break;
    int p[205];
    for(int i=0;i<m;i++)cin>>p[i];
    int gap=-1,t;
    if(m==maxi)maxi--;
    for(int i=mini-1;i<maxi;i++){
      //cout<<i+1<<": "<<p[i]-p[i+1]<<endl;
      if(gap<=p[i]-p[i+1]){
	gap=p[i]-p[i+1];
	t=i+1;
      }
    }
    cout<<t<<endl;
  }
  
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
//ranker
using namespace std;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using psi = pair<string, int>;
using D = double;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int M, min, max;

  while(1){
    cin >> M >> min >> max;

    if(M == 0 && min == 0 && max == 0) break;

    int P[M];
    REP(i, M) cin >> P[i];

    int gomi = 0;
    int cnt = 0;
    REPS(i, min-1, max){
      if(gomi <= P[i]-P[i+1]){
      gomi = P[i]-P[i+1];
      cnt = i+1;
    }
  }
    cout << cnt << endl;
  }

  return 0;
}

C++: #include <bits/stdc++.h>
#define ll long long
#define all(a) (a).begin(),(a).end()

int main(int argc, char const *argv[]) {
  while(1){
    int m=0,nmin=0,nmax=0;
    scanf("%d%d%d",&m,&nmin,&nmax);
    if(m==0 && nmin==0 && nmax==0){
      break;
    }
    std::vector<int> p(m);
    for (size_t i = 1; i <= m; i++) {
      scanf("%d",&p[i]);
    }
    int temp=0,memo=0,memoid=0;
    for (size_t i = nmin; i <= nmax; i++) {
      temp=p[i]-p[i+1];
      memo=std::max(memo,temp);
      if(memo==temp) memoid=i;
    }
    printf("%d\n",memoid);
  }


  return 0;
}

C++: #include <iostream>

using namespace std;

int main(void) {
	int m, n_min, n_max;
	int score[10001] = { 0 }, gap, ans, tmp;

	while (1) {
		cin >> m; cin >> n_min; cin >> n_max;
		if (m == 0 && n_min == 0 && n_max == 0) break;

		gap = 0;
		ans = 0;
		for (int i = 1; i <= m; i++) {
			cin >> score[i];
		}
		for (int j = n_min; j <= n_max; j++) {
			if ((tmp = score[j] - score[j + 1]) >= gap) {
				gap = tmp;
				ans = j;
			}
		}
		cout << ans <<endl;
	}

	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)

using namespace std;

int main(){
	int m, mn, mx;
	while(cin>>m>>mn>>mx, m|mn|mx){
		int P[205], diff=0, ans=0;
		rep(i,m) cin >> P[i+1];
		for(int i=mn; i<=mx; i++){
			if( P[i] - P[i+1] >= diff ){
				ans = i;
				diff = P[i] - P[i+1];
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: 5 2 4
100
90
82
70
65
5 2 4
100
90
80
75
65
3 1 2
5000
4000
3000
4 2 3
10000
10000
8000
8000
4 2 3
10000
10000
10000
8000
5 2 3
100
80
68
60
45
0 0 0

C++: #include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<map>
using namespace std;

int main() {
	int a, b, c;
	while (cin>>a>>b>>c, a | b | c) {
		map<int, int>e;
		for (int d = 0; d < a; d++) {
			int f;
			cin >> f;
			e[20000-f]++;
		}
		auto i = e.end();
		i--;
		int g = 0;
		int p = 0, q = 0;
		for (auto h = e.begin();h!=i; h++) {
			g += (*h).second;
			if (g < b)continue;
			else if (g > c)break;
			auto j = h;
			j++;
			if ((*j).first - (*h).first >= p) { p = (*j).first - (*h).first; q = g; }
		}
		cout << q << endl;
	}
}

C++: #include<bits/stdc++.h>

using namespace std;

int main(){

  int m,n_min,n_max;

  while(1){

	cin>>m>>n_min>>n_max;

	if(m==0 && n_min==0 && n_max==0)
	  break;

	vector<int> score(m+1);
	int d=0;
	int num;

	for(int i=1;i<=m;++i)
	  cin>>score[i];

	for(int i=n_min;i<=n_max;++i){
	  if(score[i]-score[i+1] >= d){
		d = score[i]-score[i+1];
		num=i;
	  }
	}
	cout<<num<<endl;
  }
  
}

C++: #include"bits/stdc++.h"

#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}


void solve();

int main() {

	solve();
	return 0;

}

void solve() {

	ll m, n_min, n_max;
	vector<ll> s;



	cin >> m >> n_min >> n_max;

	while (m > 0) {
		ll gap = 0, ans = 0;
		s.resize(m);
		REP(i, m) {

			cin >> s[i];

		}

		FOR(i, n_min-1, n_max ) {

			if (s[i] - s[i + 1] >= gap) {

				ans = i+1;
				gap = s[i] - s[i + 1];

			}

		}

		cout << ans << endl;

	}

}