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++: //inlclude before define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
#include<deque>
#include<iomanip>
#include<set>
#include<unordered_set>
#include<tuple>
#include<map>
#include<memory>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<double> VD;
typedef pair<int, int> P1;
typedef long long int ll;

//number
#define INF 1e9
#define NUM 1000000007

//itr
#define all(x) begin(x),end(x)

//repeat
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,a,b) for(int i=int(a);i<int(b);i++)

//max,min
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))

//function

/*ll gcd(ll a, ll b) {
	if (b == 0) return a;
	else return gcd(b, a%b);
}*/

/*ll lcm(ll a,ll b) {
	ll g = gcd(a, b);
	retur5n a * (b / g);
}*/

int dig(int a) {
	int sum = 0;
	while (a) {
		sum += a % 10;
		a /= 10;
	}
	return sum;
}

//grid template
int x[] = { -1, 0, 1, 0 };
int y[] = { 0,-1,0,1 };
int xx[] = { -1,-1,1,1 };
int yy[] = { 1,-1,1,-1 };

int main() {
	int m, nmin, nmax;
	while (true) {
		cin >> m >> nmin >> nmax;
		if (m == 0 && nmax == 0 && nmin == 0) {
			return 0;
		}

		VI p(m);
		rep(i, m) cin >> p[i];

		int ans = 0, maxv = -1;
		for (int i = nmin; i <= nmax; i++) {
			int div = p[i - 1] - p[i];
			if (max(div, maxv) == div || div==maxv) {
				//cout << div << " " << i << endl;
				maxv = div;
				ans = i;
			}
		}
		cout << ans << endl;

	}
	return 0;
}

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

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

int main() {
	while (true) {
		cin >> m >> a >> b;
		if (m == 0)break;
		for (int i = 0; i < m; i++) {
			cin >> p[i];
		}
		sort(p, p + m);

		/*cout << "m:" << m << " a:" << a << " b:" << b << endl;
		for (int i = 0; i < m; i++) {
			cout << p[i] << " ";
		}
		cout << endl;*/

		int ans = 0, maxnum = 0;
		for (int i = a; i <= b; i++) {
			//cout << "i:" << i << " p[m-i]:" << p[m-i] << endl;
			if (maxnum <= p[m - i]-p[m - (i + 1)]) {
				maxnum = p[m - i] - p[m - (i + 1)];
				ans = i;
			}
		}

		cout << ans << endl;
	}
}

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

int main() {
    int m, nmin, nmax;
    while(cin >> m >> nmin >> nmax, m) {
        vector<int> p(m);
        for(int i=0; i<m; ++i) {
            cin >> p[i];
        }
        int gap = 0;
        int res = 0;
        for(int i=nmax-1; i>=nmin-1 && i+1<m; --i) {
            if(gap < p[i] - p[i+1]) {
                gap = p[i] - p[i+1];
                res = i+1;
            }
        }
        cout << res << endl;
    }
}

C++: #include <stdio.h>
int main(){
	int m,a,b,x,y,r,g,i;
	for(;scanf("%d%d%d%d",&m,&a,&b,&x)>3;){
		for(g=0,i=1;i<m;i++){
			scanf("%d",&y);
			if(a<=i&&i<=b && x-y>=g)g=x-y,r=i;
			x=y;
		}
		printf("%d\n",r);
	}
	return 0;
}

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

int main(){

  int m,a,b,t=0,s;

  while(cin>>m>>a>>b){
    t=0;
    if(m==0){
      break;
    }

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

  for(int i=a;i<=b;i++){
    if(t<=p[i-1]-p[i]){
      t=p[i-1]-p[i];
      s=i;
    }
  }
  

  cout<<s<<endl;

  }

  return 0;
}

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

using namespace std;

int main()
{
  int m, n[2];
  while(cin >> m >> n[0] >> n[1], m || n[0] || n[1]){
    int P[200];
    for(int i = 0; i < m; i++) cin >> P[i];
    int idx = n[0];
    for(int i = n[0]; i <= n[1]; i++){
      if(P[i-1] - P[i] >= P[idx-1] - P[idx]) idx = i;
    }
    cout << idx << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

int m,nmin,nmax;

void solve(){
    vi p(m);
    int gap = -1;
    int ans = -1;
    rep(i,m) cin >> p[i];
    for(int i=nmin;i<=nmax;i++){
        int d = p[i-1] - p[i];
        //cout << p[i] << " " << p[i-1] << endl;
        if(gap <= d){
            gap = d;
            ans = i;
        }
    }
    cout << ans << endl;
}

int main(){
    while(1){
        cin >> m >> nmin >> nmax;
        if(m==0 and nmin == 0 and nmax == 0) break;
        solve();
    }
}

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

int m;
int nmin;
int nmax;
int ps[1000000];

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

    for (int i=0; i<m; i++) {
      scanf("%d", &ps[i]);
    }

    int ans;
    int md = -1;
    for (int i=nmax; i>=nmin; i--) {
      int d = -(ps[i] - ps[i-1]);
      if (d > md) {
        md = d;
        ans = i;
      }
    }

    printf("%d\n", ans);
  }
}

C++: #include<iostream>
#include<algorithm>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<math.h>
#include <string>
#define cinf(n,x) for(int i=0;i<(n);i++) cin >> x[i];
typedef long long int ll;
using namespace std;
int main(){
 	while(1){
 		int m,a,b; cin >>m>> a>>b;
 		if(m==0&&a==0&&b==0)break;
 		int ans=-1;
 		int dif=-1;
 		vector<int> s(m);
 		for(int i=0;i<m;i++){
 			cin >> s[i];
 		}
 		sort(s.begin(),s.end());
 		for(int i=m-b;i<=m-a;i++){
 			if(s[i]-s[i-1]>dif){
 				ans=m-i;
 				dif=s[i]-s[i-1];
 			}
 		}
 		cout << ans << endl;
 	}
 }