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<cstdio>
#include<algorithm>
#include<iterator>
#include<vector>

using namespace std;

int main(void) {
    while(1) {
        int m,nmin,nmax;
        vector<int> p;
        scanf("%d%d%d",&m,&nmin,&nmax);
        if(!m) break;

        for(int i=0; i<m; i++) {
            int p_;
            scanf("%d",&p_);
            p.push_back(p_);
        }

        sort(begin(p), end(p));

        int last=p[0];
        int maxgap=-1, res=-1;
        while(1) {
            auto ub = upper_bound(begin(p), end(p), last);
            if(ub == end(p)) break;

            last = *ub;

            if(end(p) - ub > nmax || end(p) - ub < nmin) continue;

            if(maxgap < (*ub - *(ub-1))) {
                maxgap = (*ub - *(ub-1));
                res = end(p)-ub;
            }
            
        }
        printf("%d\n",res);
    }
    return 0;
}

C++: #include <iostream>
#include <cstdlib>
using namespace std;
int main(){
  int m, nmin, nmax;
  int p[201];
  int gap;
  int ans;
  while(cin>>m>>nmin>>nmax&&m&&nmin&&nmax){
    ans = -1;
    gap = -1;

  for(int i=0; i<201; i++){
    p[i]=0;
  }

    for(int i=1; i<=m; i++){
      cin >> p[i];
    }
    for(int i=nmin; i<=nmax; i++){
      if(gap<=p[i]-p[i+1]){
        gap = p[i]-p[i+1];
        ans = i;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int m, nmin, nmax;
    while(cin >> m >> nmin >> nmax && m) {
        int p[m];
        for (int i = 0; i < m; ++i) {
            cin >> p[i];
        }
        int diff = 0, pass = 0;
        for (int i = nmin - 1; i < nmax; ++i) {
            int d = p[i] - p[i + 1];
            if (diff <= d) {
                pass = i + 1;
                diff = d;
            }
        }
        cout << pass << endl;
    }
    return 0;
}

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

using namespace std;

using i64 = long long int;
using ui64 = unsigned long long int;

////////

int main(){
    int i,j,k;
    while(cin >> i >> j >> k,i){
        vector<int> a(i);
        for(int l=0;l<i;l++){
            cin >> a[l];
        }
        sort(a.begin(),a.end(),greater<int>());
        int g = -1,s = -1;
        for(int l=j;l<=k;l++){
            if(s <= a[l-1] - a[l]){
                s = a[l-1] - a[l];
                g = l;
            }
        }
        cout << g << endl;
    }
}

C++: #include <bits/stdc++.h>
 
using namespace std;
 
int main(){
	int m,nmin,nmax;
	while(cin >> m >> nmin >> nmax,m){
		vector<int> v(m);
		for(int i=0;i<m;i++){
			cin >> v[i];
		}
		int n = 0;
		int maxi = 0;
		for(int unsigned i=nmin-1;i<nmax;i++){
			if(v[i] - v[i+1] >= maxi){
				n = i+1;
				maxi = v[i] - v[i+1];
			}
		}
		cout << n << endl;
	}
	return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
  int m, n_min, n_max;
  int p[200];
  
  while(cin >> m >> n_min >> n_max, m) {
    for (int i = 0; i < m; i++) {
      cin >> p[i];
    }
    sort(p, p+m);

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

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

using namespace std;

int main(){

    while(1){
        int m, mi, ma;
        cin>> m>> mi>> ma;
        if(!(m||mi||ma)) break;
        int P[m];
        for(int i=0; i<m; i++) cin>> P[i];

        sort(P, P+m);
        reverse(P, P+m);
        int ans=0, magap=0;
        for(int n=mi; n<=ma; n++){
            if(magap<=P[n-1]-P[n]){
                ans=n;
            }
            magap=max(magap, P[n-1]-P[n]);
        }

        cout<< ans<< endl;
    }

    return 0;
}

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

using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define all(x) x.begin(),x.end()
typedef pair<int,int> P;
typedef pair<int,P> PP;
int m,a,b;
int ans_sa;
int ans;
vector<int> stu;
int main()
{
	while(1)
	{
		stu.clear();
		int input;
		cin>>m>>a>>b;
		if(m==0)break;
		rep(i,m)
		{
			cin>>input;
			stu.push_back(input);
		}
		sort(all(stu),greater<int>());
		ans_sa=-1;
		for(int i=a-1;i<b;i++)
		{
			if(stu[i]-stu[i+1]>=ans_sa)
			{
				ans_sa=stu[i]-stu[i+1];
				ans=i+1;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <cstdio>

int P[201];

int main() {
  int m, nmin, nmax;
  while (true) {
    scanf("%d %d %d", &m, &nmin, &nmax);
    if (m == 0 && nmin == 0 && nmax == 0) break;
    for (int i=0;i<m;i++) scanf("%d", &P[i]);
    int max_gap = -1, max_n = -1;
    for (int n=nmin;n<=nmax;n++) {
      const int gap = P[n-1]-P[n];
      if (gap >= max_gap) {
        max_gap = gap;
        max_n = n;
      }
    }
    printf("%d\n", max_n);
  }
  return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
#include <complex>
#include <utility>
#include <numeric>
#define  rep(i,n) for(int i=0;i<(n);i++)
#define  REP(i,a,n) for(int i=a;i<(n);i++)
#define  rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define  VI	vector<int>
#define	 VS vector<string>
#define  all(a) (a).begin(),(a).end()
#define  debug(x) cout<<#x<<": "<<x<<endl
using namespace std;
typedef long long ll;

const int INF=1000000;
char fi[101][101];
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
double EPS = 1e-10;
int N,M;
int sx,sy;
int gx,gy;
int w,h;
int ans;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
const int MAX_V=100;
const int MAX_N=100;
char o[3]={'+','-','*'};
#define md 1000003


int dp[353][353]={0};
int bow[353][353]={0};
double add(double a,double b){
	if(abs(a+b)<EPS*(abs(a)+abs(b)))
	return 0;
	return a+b;
}

struct P{
	double x,y;
	P(){}
		P(double x,double y):x(x),y(y){
		}
		P operator + (P p){
			return P(add(x,p.x),add(y,p.y));
		}
		P operator - (P p){
			return P(add(x,-p.x),add(y,-p.y));
		}
		P operator *(double d){
			return P(x*d,y*d);
		}
		double dot(P p){
			return add(x*p.x,y*p.y);
		}
		double det(P p){
			return add(x*p.y,-y*p.x);
		}
};

bool cmp_x(const P& p,const P& q){
	if(p.x!=q.x) return p.x<q.x;
	return p.y<q.y;
}

vector<P> convex_hull(P* ps, int n){
	sort(ps,ps+n,cmp_x);
	int k=0;
	vector<P> 	qs(n*2);
	
	rep(i,n){
		while(k>1&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)
			k--;
		qs[k++]=ps[i];
	}
	for(int i=n-2,t=k;i>=0;i--){
		while(k>t&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)
		k--;
		qs[k++]=ps[i];
	}
	qs.resize(k-1);
	return qs;
}

int n,m;
vector<double> p;
P ps[101];
char c[520][520];

int main(){
	
	int n,max,min;
	while(cin>>n>>min>>max,n!=0&&min!=0&&max!=0){
		int ans=0;
		int com=min;
		vector<int> p(n+100);
		rep(i,n)
			cin>>p[i];
		
		for(int i=min-1;i<max;i++){
			if(p[i]-p[i+1]>=ans){
				ans=p[i]-p[i+1];
				com=i+1;
			}
		}
		cout<<com<<endl;
	}
}