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++: #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define mod 1000000007
using namespace std;
typedef long long ll;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//V,P(大文字)使用不可
//乗算の際にオーバーフローに注意せよ！！（適切にmodをとれ）
//制約をよく読め！

const ll INF=1e18;

signed main(){
    while(true){
        int m,mi,ma;
        cin>>m>>mi>>ma;
        if(m==0&&mi==0&&ma==0) break;
        V<int> p(m);
        cinf(m,p);
        int cnt=0;
        int ans;
        for(int i=mi;i<=ma;i++){
            if(p[i-1]-p[i]>=cnt){
                cnt=p[i-1]-p[i];
                ans=i;
            }
        }
        cout<<ans<<endl;
    }
}

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

using namespace std;

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

    while(1){
        int m,nmin,nmax;
        cin>>m>>nmin>>nmax;

        if(m==0)break;

        vector<int> p(m);
        for(int i=0;i<m;i++)cin>>p[i];

        int ans=0,point=0;

        for(int i=nmin;i<=nmax;i++){
            int gap=p[i-1]-p[i];
            if(point<=gap){
                ans=i;
                point=gap;
            }
        }

        cout<<ans<<endl;

    }

}

C++: #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const ll INF = 1e9;
const ll MOD = 1e9 + 7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int m, n1, n2;
void solve() {
    int p[202];
    rep(i, m) cin >> p[i];
    int ans = n1;
    for (int i = n1; i <= n2; i++) {
        if (p[i - 1] - p[i] >= p[ans - 1] - p[ans]) {
            ans = i;
        }
    }
    cout << ans << endl;
}
int main() {
    while (cin >> m >> n1 >> n2) {
        if (m == 0) break;
        solve();
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int m;
vector<int>p;
vector<int>s;
int maxn,minn;
 
 
int main(){
  int i,j,now=0,ni=0;
  while(1){
  cin >> m >> minn >> maxn;
  now = 0;
  if(m==0&&maxn==0&&minn==0)break;
  for(i=0;i<m;i++){
    cin >> j;
    p.push_back(j);
  }
  sort(p.begin(),p.end());
  for(i=0;i<m-1;i++)  s.push_back(p[i+1]-p[i]);
  for(i=m-minn-1;i>=m-maxn-1;i--){
    // cout << " bbb"<<s[i];
    if(s[i]>=now){
      now = s[i];
      ni = i;
      //cout <<"aaa"<< now << " "<< ni << endl;
    }
  }
  //cout <<endl<< ni << endl;
  cout << m-1-ni << endl;
  while(p.size())p.pop_back();
  while(s.size())s.pop_back();
  }
  return 0;
}

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

int main(){
    int m,nl,ns;
    while(cin>>m>>ns>>nl,m){
        vector<int> p(m);
        for(int i=0;i<m;i++) cin>>p[i];
        int res=0;
        int gap=0;
        for(int i=0;i<=10000;i++){
            int mi=1000000;
            int ma=0;
            int cnt=0;
            for(int j=0;j<m;j++){
                if(i<=p[j]){
                    cnt++;
                    mi=min(mi,p[j]);
                }
                else{
                    ma=max(ma,p[j]);
                }
            }
            int ga=mi-ma;
            if(ns<=cnt && cnt<=nl){
                if(gap<=ga){
                    res=cnt;
                    gap=ga;
                }
            }
        }

        cout<<res<<endl;

    }


}

C++: /* template.cpp {{{ */
#include <bits/stdc++.h>
using namespace std;
#define get_macro(a, b, c, d, name, ...) name
#define rep(...) get_macro(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep(...) get_macro(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define rep1(n) rep2(i_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, b) rep4(i, a, b, 1)
#define rep4(i, a, b, s) for (ll i = (a); i < (ll)(b); i += (ll)(s))
#define rrep1(n) rrep2(i_, n)
#define rrep2(i, n) rrep3(i, 0, n)
#define rrep3(i, a, b) rrep4(i, a, b, 1)
#define rrep4(i, a, b, s) for (ll i = (ll)(b) - 1; i >= (ll)(a); i -= (ll)(s))
#define each(x, c) for (auto &&x : c)
#define fs first
#define sc second
#define all(c) begin(c), end(c)
using ui = unsigned;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
const int inf = 1e9 + 10;
const ll inf_ll = 1e18 + 10;
const ll mod = 1e9 + 7;
const ll mod9 = 1e9 + 9;
const int dx[]{-1, 0, 1, 0, -1, 1, 1, -1};
const int dy[]{0, -1, 0, 1, -1, -1, 1, 1};
template<class T, class U> void chmin(T &x, const U &y){ x = min<T>(x, y); }
template<class T, class U> void chmax(T &x, const U &y){ x = max<T>(x, y); }
struct prepare_ { prepare_(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(12); } } prepare__;
/* }}} */

int m, a, b, p[200];

int main(){
  while (cin >> m >> a >> b, m){
    rep(i, m) cin >> p[i];
    sort(p, p + m, greater<int>());
    int mx = 0, res = 0;
    rep(i, a, b + 1){
      chmax(mx, p[i - 1] - p[i]);
      if (mx == p[i - 1] - p[i]){
        res = i;
      }
    }
    cout << res << endl;
  }
}

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

int main() {
  
  while (1) {

    int n, nmin, nmax, x;
    vector<int> vc;

    cin >> n >> nmin >> nmax;
    if (n == 0 && nmin == 0 && nmax == 0) break;

    for (int i = 0; i < n; i++) {
      cin >> x;
      vc.push_back(x);
    }

    sort(vc.begin(), vc.end());
    reverse(vc.begin(), vc.end());

    int gap = 0;
    int ans = 0;

    for (int i = nmin - 1; i < nmax; i++) { 
      int tmp = vc[i] - vc[i + 1];
      if (tmp >= gap) {
        gap = tmp;
        ans = i + 1;
      }
    }

    cout << ans << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define REP(i,x,n) for(int i = x; i < n; i++)

void solve(int n, int l, int r) {
	vector<int> a(n);
	REP(i,0,n) cin >> a[i];
	sort(a.begin(), a.end());
	reverse(a.begin(), a.end());
	int mx = 0, ans = 0;
	REP(i, l, r + 1) {
		if (mx <= a[i - 1] - a[i]) {
			mx = a[i-1]-a[i];
			ans = i;
		}
	}
	cout << ans << endl;
}

signed main(){
	int n, l, r;
	while (cin >> n >> l >> r,n) {
		solve(n,l,r);
	}
	return 0;
}