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>
using namespace std;

int main () {
  int m, nmin, nmax, tempa, tempb, sa=0;
  while(cin >>m>>nmin>>nmax) {
    int temp = 0;
    sa = 0;
    if(m == 0 && nmin == 0 && nmax == 0)break;
  cin>> tempa;
  for (int i=1;i<m;i++) {
    cin>> tempb;
    if(nmin <= i&& i<= nmax&&sa <= tempa - tempb) {
      sa = tempa - tempb;
      temp = i;
    }
    tempa = tempb;
  }
  cout << temp<< endl;
}
  return 0;
}

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

int main(){
	while(1){
		int m,nmin,nmax;
		
		cin>> m>>nmin>>nmax;
		
		if(m==0 && nmin==0 && nmax == 0)
			break;
			
		int P[m];
		for(int i=0; i<m ;i++){
			cin>>P[i];
		}
		
		int maxgap=0;
		int chosen=0;
		for(int i=nmin-1; i<nmax; i++){
			
			if(maxgap <= (P[i]-P[i+1])){
				maxgap=P[i]-P[i+1];
				chosen=i+1;
			}
		}
		cout<<chosen<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
const ld eps=1e-8;
int main() {
	int n, s, g;
	while (cin >> n >> s >> g, n) {
		int x[300];
		rep(i, n) {
			cin >> x[i];
		}
		sort(x, x + n,greater<int>());
		int ma = 0; int chk;
		Rep1(i,s,g) {
			if (ma <= x[i - 1]-x[i]) {
				ma = x[i - 1] - x[i]; chk = i;
			}
		}
		cout << chk << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
 
#define loop(n, i) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;

using namespace std;
typedef long long ll;

int main()
{
    int m, min, max;
    cin >> m >> min >> max;
    vector<int> v;
    loop(m, i) {
        int j; cin >> j;
        v.push_back(i);
    }

    int gap = 0;
    int ans = 0;
    for (int i = min; i < max; i++) {
        if (gap < v[i-1] - v[1]) {
            gap = v[i-1] - v[1];
            ans = i;
        }
    }
    cout << ans << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int m,n1,n2;
    int p[300];
    while(cin>>m>>n1>>n2,m){
        for(int i=0;i<m;i++) cin>>p[i];
        sort(p,p+m);
        reverse(p,p+m);
        int mx_g=0,mx_m=0;
        for(int i=0;i<m;i++){
            if(i<n1-1 || i>n2-1 || n1-1<0 || n2-1>m-1) continue;
            if(p[i]-p[i+1]>=mx_g){
                mx_g=p[i]-p[i+1];
                mx_m=max(mx_m,i+1);
            }
        }
        cout<<mx_m<<endl;
    }
    return 0;
}

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

int main(){
  int m,n_min,n_max,gap,temp=0;
  while(1){
    cin >> m >> n_min >> n_max;
    if(m==0 && n_min==0 && n_max==0){break;}
    int P[m+1];
    P[0]=-1;
    for(int i=1;i<=m;i++){
      cin >> P[i];
    }
    gap=0;
    for(int i=n_min;i<=n_max;i++){
      if(P[i]-P[i+1]>=gap){
        gap=P[i]-P[i+1];
        temp=i;
      }
    }
    cout << temp << endl;
  }
}

C++: 
#include <iostream>

using namespace std;

int main()
{
    int m, n_min, n_max;
    while (cin >> m >> n_min >> n_max, m)
    {
        int a[m] = {0};
        int gap[m] = {0};
        int MAX = 0;
        int MAX_n = 0;
        for (int i = 0; i < m; i++)
        {
            cin >> a[i];
            if (i > 0)
            {
                gap[i] = a[i - 1] - a[i];
            }
        }
        for (int i = n_min; i < n_max + 1; i++)
        {
            if (gap[i] >= MAX)
            {
                MAX = gap[i];
                MAX_n = i;
            }
        }
        cout << MAX_n << endl;
    }
}

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

int main(void)
{
    int m, nm, nM;

    while (std::cin >> m >> nm >> nM, m) {
        std::vector<int> pts;
        for (int i = 0; i < m; i++) {
            int t;
            std::cin >> t;
            pts.push_back(t);
        }

        std::vector<int> gaps;
        for (int i = nm - 1; i < nM; i++) {
            gaps.push_back(pts[i] - pts[i+1]);
        }

        int max_gap = gaps[0];
        int idx;
        for (int i = 0; i < gaps.size(); i++) {
            if (max_gap <= gaps[i]) {
                idx = i + nm;
            }
        }

        std::cout << idx << std::endl;
    }
    
    return 0;
}

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

#define REP(i, n ,N) for(int i = (n); i < (N); i++)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;

int main(){
	while(1) {
		int m,nmin, nmax;
		cin >> m >> nmin >> nmax;
		if(m==0 && nmin==0 && nmax==0)break;
		int  max = 0, ans;
		vector<int> member(m + 1);
		REP(i,1,m+1){
			cin >> member[i];
		}

		REP(i, nmin, nmax + 1) {
			if (member[i] - member[i + 1] >= max) {
				max = member[i] - member[i + 1];
				ans = i;
			}
		}
		p(ans);
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <tuple>
#include <cassert>
#include <exception>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
static const int INF = 1e+9+7;
ll n,m,l;
string s,t;
int d[200010],dp[1010][1010];
double w[1000],v[1000];
double box[200010];
char field[200][200];

int main(){
  while(1){
    cin >> n >> m >> l;
    if(n == 0 && n == m && m == l)break;
    rep(i,0,n)cin >> d[i];
    m--;l--;
    int gap = 0;
    int ans = 0;
    lep(i,m,l){
      if(d[i] - d[i+1] >= gap){
        gap = d[i] - d[i+1];
        ans = i + 1;
      }
    }
    print(ans);
  }
  return 0;
}