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>
                            #include<iostream>
                            #include<cstdio>
                            #include<vector>
                            #include<queue>
                            #include<map>
                            #include<cstring>
                            #include<string>
                            #include <math.h>
                            #include<algorithm>
                        //    #include <boost/multiprecision/cpp_int.hpp>
                            #include<functional>
                 //    #define int long long
                            #define inf  1000000007
                            #define pa pair<int,int>
                            #define ll long long
                            #define pal pair<double,pa>
                            #define ppa pair<pa,int>
                            #define ppap pair<int,pa>
                            #define ssa pair<string,int>
                            #define  mp make_pair
                            #define  pb push_back
                            #define EPS (1e-10)
                            #define equals(a,b) (fabs((a)-(b))<EPS)
                     
                            using namespace std;
                     //priority_queue<int, vector<int>, greater<int> > que;
                            class Point{
                            	public:
                            	double x,y;
                            	Point(double x=0,double y=0):x(x),y(y) {}
                            	Point operator + (Point p) {return Point(x+p.x,y+p.y);}
                            	Point operator - (Point p) {return Point(x-p.x,y-p.y);}
                            	Point operator * (double a) {return Point(x*a,y*a);}
                            	Point operator / (double a) {return Point(x/a,y/a);}
                            	double absv() {return sqrt(norm());}
                            	double norm() {return x*x+y*y;}
                            	bool operator < (const Point &p) const{
                            		return x != p.x ? x<p.x: y<p.y;
                            	}
                            	bool operator == (const Point &p) const{
                            		return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
                            	}
                            };
                            typedef Point Vector;
                     
                            struct Segment{
                            Point p1,p2;
                            };
                     
                        double hen(Vector a){
                        if(fabs(a.x)<EPS && a.y>0) return acos(0);
                        else if(fabs(a.x)<EPS && a.y<0) return 3*acos(0);
                        else if(fabs(a.y)<EPS && a.x<0) return 2*acos(0);
                        else if(fabs(a.y)<EPS && a.x>0) return 0.0;
                        else if(a.y>0) return acos(a.x/a.absv());
                        else return 2*acos(0)+acos(-a.x/a.absv());
                     
                        }
                     
                string itos( int i ) {
                ostringstream s ;
                s << i ;
                return s.str() ;
                }
                 
                int gcd(int v,int b){
                	if(v>b) return gcd(b,v);
                	if(v==b) return b;
                	if(b%v==0) return v;
                	return gcd(v,b%v);
                }
                            double dot(Vector a,Vector b){
                            	return a.x*b.x+a.y*b.y;
                            }
                            double cross(Vector a,Vector b){
                            	return a.x*b.y-a.y*b.x;
                            }
                        
                double distans(double x1,double y1,double x2,double y2){
                	double rr=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
                	return sqrt(rr);
                	
                }
                /*}
int pr[100010];
//int inv[100010];
 
int beki(int wa,int rr){
	if(rr==0) return 1ll;
	if(rr==1) return wa;
	if(rr%2==1) return (beki(wa,rr-1)*wa)%inf;
	int zx=beki(wa,rr/2);
	return (zx*zx)%inf;
}
  
void gya(){
	pr[0]=1;
	for(int i=1;i<100010;i++){
		pr[i]=(pr[i-1]*i)%inf;
	}
	for(int i=0;i<100010;i++) inv[i]=beki(pr[i],inf-2);
	
}

*/

                         //----------------kokomade tenpure------------


string s[50],t[50];
signed main(){
	int n,m,r;
	/*
	double d;
	cin>>d;
	
	double ans=0;
	for(int i=0;i<=10;i++){
		if(i>d) break;
		double ii=i+0.0;
		ans=max(ans,sqrt(d*d-ii*ii));
	}
	printf("%.10lf\n",ans);
	*/
	
	while(1){
		int na,nb;
	cin>>n>>na>>nb;
		vector<int> ve;
		if(n==0) return 0;
		for(int i=0;i<n;i++){
			int ty;
			cin>>ty;
			ve.pb(ty);
		}
	int	ans=0,ans2=0;
		for(int i=na-1;i<nb;i++){
			if(ans2<=ve[i]-ve[i+1]){
				ans2=ve[i]-ve[i+1];
				ans=i;
			}
		}
		cout<<ans+1<<endl;
		
	}
	
	
	return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

#define EPS 1e-10
#define INF 1000000
#define mp make_pair
#define pb push_back

typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pii;
typedef long long ll;

int const N_MAX = 100000;

int main() {
	int m, n_min, n_max;
	while (1) {
		cin >> m >> n_min >> n_max;
		if (!m && !n_min && !n_max) {
			return 0;
		}
		vi points, people(N_MAX+1, 0);
		for (int i = 0; i < m; i++) {
			int p;
			cin >> p;
			points.pb(p);
			people[p]++;
		}
		sort(points.begin(), points.end(), greater<int>());
		for (int i = N_MAX; i > 0; i--) {
			people[i-1] += people[i];
		}

		pii ans = mp(0, 0);
		for (int i = 0; i < points.size(); i++) {
			int point = points[i],
					n = people[point];
			if (n < n_min) {
				continue;
			} else if (n > n_max) {
				break;
			}
			int diff = point - points[i+1];
			if (diff > ans.second || (diff == ans.second && n > ans.first)) {
				ans = mp(n, diff);
			}
		}

		cout << ans.first << endl;
	}
}

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

int main() {
  int n, left, right;
  vector<int> p;

  while (cin >> n >> left >> right, n) {
    p.resize(n);
    rep (i, n) cin >> p[i];

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

    int n_passed = 0;
    int max_gap = 0;

    rep (i, n-1) {
      // cout << "i: " << i << endl;
      if (max_gap <= p[i] - p[i+1]) {
        // cout << "new gap: " << p[i] - p[i+1] << endl;
        // cout << left << ", " << i+2 << ", " << right << endl;
        if (left<=i+2 && i+2<=right) {
          n_passed = i+2;
          max_gap = p[i] - p[i+1];
        }
      }
    }
    cout << n_passed << endl;
  }
  return 0;
}