Go: /*
	http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1600&lang=jp
	Entrance Examination
*/

package main

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

// 標準入力を取得するScannerのインスタンスを作成
var scanner = bufio.NewScanner(os.Stdin)

// 標準入力で各行を読み込みintとして返す

func readLine() int {
	if scanner.Scan() {
		number, _ := strconv.Atoi(scanner.Text())
		return number
	}
	return 0
}

func main() {
	// 改行から空白区切りに変更
	scanner.Split(bufio.ScanWords)

	// 0 0 0の行に到達するまでループする
	for {
		// 合格者、不合格者の境目=ギャップ
		m := readLine()   // 受験者の人数
		min := readLine() // 合格者の最小人数
		max := readLine() // 合格者の最大人数

		// 0 0 0の行に到達したのでループを抜け終了する
		if m == 0 && min == 0 && max == 0 {
			break
		}

		// 得点を格納するsliceを初期化
		ps := make([]int, 0, m)

		// sliceに得点を格納する
		for i := 0; i < m; i++ {
			ps = append(ps, readLine())
		}

		tmp := 0    // ギャップを一時的に保存
		gap := 0    // ギャップの最大値を保存
		answer := 0 // ギャップが最大になった時のindex(合格人数)を保存

		// 合格者の最小人数〜最大人数のギャップを計算する
		for i := min; i <= max; i++ {
			tmp = ps[i-1] - ps[i]

			// ギャップの最大値が更新された場合、最大値と合格人数を更新する
			// ギャップが同じ値だった場合も合格人数を更新する
			// (合格人数が多い方が優先されるので後から現れた値が優先される)
			if tmp >= gap {
				gap = tmp
				answer = i
			}
		}
		fmt.Println(answer)
	}
}

C++: #include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
vector<int>score(201);
int main() {
	int m, nmin, nmax;
	
	while (cin >> m >> nmin >> nmax, !(m == 0 && nmin == 0 && nmax == 0)) {
		
		for (int i = 0; i < m; i++) {
			cin >> score[i];
		}
		int ans=0;
		int s = 0;
		for (int i = nmin-1; i <= nmax-1; i++) {
			
			if (s <= score[i ] - score[i+1]) {
				ans = max(ans,i+1);
				s = max(s, score[i ] - score[i+1]);
				
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main(){
	int m, min, max, a[300], ans, t = 0;
		
	while (1){
		cin>>m>>min>>max;
		if(m == 0 && min == 0 && max == 0){
			break;
		}
		for(int i = 1; i <= m; i++){
			cin>>a[i];
		}
		for(int i = min; i <= max; i++){
			if(a[m - i + 1] - a[m - i] >= t){
				t = a[m - i] - a[m - i - 1];
				ans = i;
			}
		}
		cout<<ans<<endl;
		
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
int tx[] = {0,1,0,-1};
int ty[] = {-1,0,1,0};

int main(){
  int num_student;
  int num_min_pass;
  int num_max_pass;
  while(~scanf("%d %d %d", &num_student, &num_min_pass, &num_max_pass)) {
    if (num_student == 0) break;

    int score[10000];
    for (int student_i = 0; student_i < num_student; student_i++) {
      scanf("%d", &score[student_i]);
    }
    sort(score,score + num_student, greater<int>());
    int diff = -1;
    int res = 0;
    for (int pass_i = num_min_pass - 1; pass_i < num_max_pass; pass_i++) {
      int min_pass_score = score[pass_i];
      int max_fail_score = score[pass_i + 1];
      if (diff <= min_pass_score - max_fail_score) {
	diff = min_pass_score - max_fail_score;
	res = pass_i + 1;
      }
    }
    printf("%d\n",res);
  }
}

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

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

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

int main(void){
  int m, nmin, nmax;
  while(cin >> m >> nmin >> nmax, m | nmin | nmax){
    vector<int> P(m);
    for(int i = 0; i < m; i++) cin >> P[i];
    sort(P.begin(), P.end(), greater<int>());
    int ans = 0;
    int gap = 0;
    for(int n = nmin; n <= nmax; n++){
      if(gap <= P[n-1] - P[n]){
          gap = P[n-1] - P[n];
          ans = n;
      }
    }
    cout << ans << endl;
  }
}

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

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;

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

  int m,mi,ma;
  while(true){
    cin >> m >> mi >> ma;
    if(m==0) break;
    std::vector<int> v;
    for(int i=0;i<m;i++){
      int p;cin >> p;
      v.push_back(p);
    }
    sort(v.begin(),v.end(),greater<int>());
    int gap=-1,n=mi;
    for(int i=mi-1;i<ma;i++){
      int temp=v[i]-v[i+1];
      if(temp>=gap){
        gap=temp;
        n=i+1;
      }
    }
    cout << n << endl;
  }
}

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

int main(void) {
	int num, max, min, tem, point[200], flag;
	vector<int> ans;
	
	while (cin >> num >> min >> max, num && min && max) {
		tem = -1;
		flag = 0;
		for (int i = 1;i <= num;i++) {
			cin >> point[i];
		}
		for (int i = min;i <= max;i++) {
			if (tem <= point[i] - point[i + 1]) {
				tem = point[i] - point[i + 1];
				flag = i;
			}
		}
		ans.push_back(flag);
	}

	for (auto itr = ans.begin();itr != ans.end();itr++) {
		cout << *itr << endl;
	}

	return 0;
}

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

int main() {
	int N, A, B;
	while (cin >> N >> A >> B) {
		if (N == 0) return 0;
		vector<int> P(N);
		for (int i = 0; i < N; i++) cin >> P[i];
		int MAX = -1, ANS = -1;
		for (int i = A; i <= B; i++) {
			if (P[i - 1] - P[i] >= MAX) MAX = P[i - 1] - P[i], ANS = i;
		}
		cout << ANS << endl;
	}
}

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 = 1; 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;

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

int main()
{
    int m,a,b;
    while(cin >>m >>a >>b,m)
    {
        vector<int> p(m);
        rep(i,m) cin >>p[i];

        int ans=b;
        int gap=0;

        //????????????i?????¨??????
        for(int i=b; i>=a; --i)
        {
            int tgap=p[i-1]-p[i];
            if(tgap>gap)
            {
                gap=tgap;
                ans=i;
            }
        }

        cout << ans << endl;
    }
    return 0;
}

C++: #if 1
  #include <bits/stdc++.h>
#else
  #include "../../bits/stdc++.h"
#endif

#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (b)-1;i >= (a);i--)
#define REP(i,n) FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))

using namespace std;

typedef pair<int, int> P;
#define pb push_back
#define mp make_pair
#define ft first
#define sd second

int m, nin, nax;
int p[202];

bool input(){
  cin>>m>>nin>>nax;
  REP(i, m)cin>>p[i];
  return m;
}

void solve(){
  int s=0, b=0;
  FOR(i, nin-1, nax) {
    if(p[i]-p[i+1]>=s){
      b=i+1;
      s=p[i]-p[i+1];
    }
  }
  cout<<b<<endl;
}

int main(){
  cin.tie(0);
  
  while (input()){
      solve();
  }
  
  return 0;
}