Go: // Entrance Examination(入学試験)
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1600&lang=jp
package main

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

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
		}

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

		gapMax, pass := 0, 0
		for n := nMin; n <= nMax; n++ {
			gap := points[n-1] - points[n]
			if gap >= gapMax {
				gapMax, pass = gap, n
			}
		}

		fmt.Println(pass)
	}
}

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

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

int main(){
  int m,nmin,nmax,dmax,num;

  while(true){
    cin >> m >> nmin >> nmax;
    
    if(m == 0 && nmin == 0 && nmax == 0) break;

    int *score = new int[m];

    
    for(int i = 0; i<m; ++i)
      cin >> score[i];
    
    
    for(int i=nmin; i<nmax+1; ++i){
      if(i == nmin) dmax = score[i-1] - score[i];


      //cout << score[i-1] << " - " << score[i] << endl;
      if(score[i-1] - score[i] >= dmax){
	dmax = score[i-1] - score[i];
	num = i;

	//cout << num << " ******" << endl;
      }
    }

    delete[] score;

    cout << num << endl;
    
    dmax = num = 0;
    
  }
  return 0;
}

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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}


signed main(){
    int M,L,R;
    while(cin>>M>>L>>R,M||L||R){
        vint P(M);rep(i,M)cin>>P[i];
        sort(all(P));reverse(all(P));

        int val=0,ma=0;
        for(int i=L-1;i<R;i++){
            int tmp=P[i]-P[i+1];
            if(tmp>=val){
                val=tmp;
                ma=i+1;
            }
        }
        cout<<ma<<endl;
    }
    return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

struct UnionFind {
	vector<int> v;
	UnionFind(int n) : v(n)  { for (int i = 0; i < n; i++) v[i] = i; }
	int  find(int x)         { return v[x] == x ? x : v[x] = find(v[x]); }
	void unite(int x, int y) { v[find(x)] = find(y); }
};

int main() {
	int m, nmin, nmax;
	while (cin >> m >> nmin >> nmax, m) {
		vi stu(m);
		REP(i, m)
			cin >> stu[i];
		int gp = 0;
		int ans = -1;
		FOR(i, nmin, nmax + 1) {
			if (gp <= stu[i - 1] - stu[i]) {
				gp = stu[i - 1] - stu[i];
				ans = i;
			}
		}
		cout << ans << endl;
	}
}

C++: #include<iostream>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int m,na,ni,ans;
	while(cin>>m>>ni>>na,(m||ni)||na){
		int p[m];
		rep(i,m)cin>>p[i];
		sort(p,p+m);
		int gap=0;
		loop(i,ni,na+1){
			if(gap<=p[m-i]-p[m-i-1]){
				ans=i;
				gap=p[m-i]-p[m-i-1];
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main(void) {
    while (1) {
        int m, nmin, nmax;
        scanf("%d%d%d", &m, &nmin, &nmax);
        if (m == 0 && nmin == 0 && nmax == 0) break;

        int P[m];
        for (int i = 0; i < m; ++i) {
            cin >> P[i];
        }

        sort(P, P + m, greater<int>());
//        for (int i = 0; i < m; ++i) {
//            cout << P[i] << endl;
//        }
        int maxgap = 0;
        int maxgapn;
        for (int i = nmin; i <= nmax; ++i) {
            int gap = P[i] - P[i + 1];
            if (gap >= maxgap) {
                maxgapn = i;
                maxgap = gap;
            }
        }

        cout << maxgapn + 1 << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <map>
#define rep(i,n) for(long long i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll MOD = 1000000007;

int m, n1, n2;
int p[200];

void solve(){
	rep(i,m) cin >> p[i];
	sort(p,p+m,greater<int>());
	int ans = 0;
	int gap = 0;
	for(int i = n1-1; i < n2; i++) if(gap <= p[i]-p[i+1]){ gap = p[i]-p[i+1]; ans = i+1; }
	cout << ans << endl;
}

int main(){
	while(cin >> m >> n1 >> n2){
		if(m == 0 && n1  == 0 && n2 == 0) break;
		solve();
	}	
}

C++: #include<cstdio>

int main() {
	int m, nmin, nmax, p[100001], maxg = 0 , n;
	while (1) {
		scanf("%d %d %d", &m, &nmin, &nmax);
		for (int i = 0; i < m; i++) {
			scanf("%d", &p[i]);
		}
		for (int j = nmin; j <= nmax; j++) {
			if (p[j] - p[j - 1] > maxg) {
				maxg = p[j] - p[j - 1];
				n = j;
			}
			printf("%d\n", n);
		}
		if (m == nmin == nmax == 0)return 0;
	}
}

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

int M, Nmin, Nmax;
vector<int> P;

void solve(){
    sort(P.rbegin(), P.rend());
    
    int gap = 0;
    int ans = -1;
    for(int i=Nmin-1; i<Nmax; i++){
        if(P[i]-P[i+1] >= gap){
            gap = P[i]-P[i+1];
            ans = i + 1;
        }
    }
    cout << ans << endl;
}

int main(){
    while(cin >> M >> Nmin >> Nmax, M|Nmin|Nmax){
        P.resize(M);
        for(auto &v: P)
            cin >> v;
        solve();
    }
}

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

int main(){

  int nmin,nmax,m;
  vector<int> point(0);
  int gap,ans;

  while(cin>>m>>nmin>>nmax , nmin&&nmax&&m){
    point.resize(m);
    gap = 0;
    
    for(int i=0; i<m; i++)cin >> point[i];

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

    //for(int i=0;i<point.size();i++)cout << point[i]<<' ';
    
    for(int i=nmin-1; i<nmax; i++){
      if(point[i]-point[i+1] >= gap){
	gap = point[i]-point[i+1];
	ans = i+1;
      }
    }

    cout << ans << endl;

  }


  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
int main()
{
  int m, small, big, P[201];
 
  while(cin >> m >> small >> big, m) {
    for(int i = 1; i <= m; i++) {
      cin >> P[i];
    }
    int calc = 0;
    for(int i = big; i >= small; i--) {
      calc = max(calc, P[i] - P[i + 1]);
    }
    for(int i = big; i >= small; i--) {
      if(calc == P[i] - P[i + 1]) {
        cout << i << endl;
        break;
      }
    }
  }
  return(0);
}