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<bits/stdc++.h>
#define M 205
using namespace std;
int m,nmin,nmax,p[M],maxp,ans;

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

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

int main (int argc, char *argv[]) {
    int m, n_min, n_max, p;
    vector<int> v;

    while (cin>>m>>n_min>>n_max, m||n_min||n_max) {
        for (int i = 0; i < m; ++i) {
            cin>>p;
            v.push_back(p);
        }
        sort(v.begin(), v.end(), greater<int>());
        int size = static_cast<int>(v.size());
        int diff = 0;
        int ans = 0;
        for (int i = n_max - 1; i >= n_min - 1; --i) {
            if (v[i] - v[i+1] > diff) {
                diff = v[i] - v[i+1];
                ans = i;
            }
        }
        cout<<ans+1<<endl;
        v.clear();
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define FOR(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
using namespace std;

void _main() {
    int m, nmin, nmax;
    while (cin >> m >> nmin >> nmax, m) {
        vector<int> P(m);
        REP (i, m) cin >> P[i];
        int tmp = 0, ans = -1;
        FOR (i, nmin, nmax + 1) {
            if (P[i - 1] - P[i] >= tmp) {
                tmp = P[i - 1] - P[i];
                ans = i;
            }
        }
        cout << ans << endl;
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

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

int main(){
	int m,n1,n2;
	cin >> m>>n1>>n2;
	while(m!=0||n1!=0||n2!=0){
	int p[m];
	for(int i = 0; i < m; i++){
		cin>>p[i];
	}
	int g = 0;
	for(int i = n1; i <= n2; i++){
		cout <<p[i]<<":"<<p[i-1]<<endl;
		g = max(g,p[i-1]-p[i]);
	}
	for(int i = n2; i >= n1; i--){
		if(g==p[i-1]-p[i]){
			cout << i<<endl;
			break;
		}
	}
	cin >> m>>n1>>n2;
	}
	return 0;
}

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

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

        int cur,prev;
        cin >> prev;
        int pmax=0,gmax=0;
        for(int i=1; i<m; i++){
            cin >> cur;
            if(nmin<=i && i<=nmax){
                int gap = prev-cur;
                if(gap >= gmax){
                    gmax = gap;
                    pmax = i;
                }
            }
            prev = cur;
        }
        cout << pmax << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rall(c) (c).rbegin(), (c).rend()

int main() {
    for (int m, a, b; cin >> m >> a >> b, m | a | b;) {
        vector<int> p(m);
        for (int& e : p) cin >> e;
        sort(rall(p));
        int n = a;
        for (int i = a + 1; i <= b; ++i) if (p[i - 1] - p[i] >= p[n - 1] - p[n]) n = i;
        cout << n << endl;
    }
}

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 <stdio.h>
#include <vector>
#include <algorithm>

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

using namespace std;

int main(void){
    
    int student = 0;
    int maxN,minN = 0;
    int gap = 0,gapMax = 0,gapnumber  = 0;
    int score[1020] = {0};
    
    while(cin >> student >>minN >>maxN,student+maxN+minN)
    {
        REP(i,student)
        cin >> score[i];
  
    
    FOR(j,minN,maxN+1)
        {
            gap = score[j-1] - score[j];

            if(gapMax <= gap)
            {
                gapnumber = j;
                gapMax = gap;
                
            }
        }
        cout << gapnumber << endl;
        gapMax  =-1;
        gapnumber = 0;
    
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

int main() {
  i64 m, nm, nM;
  while(cin >> m >> nm >> nM, m) {
    vector<i64> P(m);
    rep(i,0,m) cin >> P[i];
    sort(all(P));
    reverse(all(P));
    i64 ans = -1e18;
    i64 res = 0;
    rep(i,nm,nM + 1) {
      i64 tmp = ans;
      ans = max(ans, P[i - 1] - P[i]);
      if(tmp <= P[i - 1] - P[i]) {
        res = i;
      }
    }
    cout << res << endl;
  }
}

C++: #include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

int main() {
	int m, tibi, deka;
	int data[300];
	int n = 0;
	int sa = -10;
	int basyo = 0;
	while (true) {
		sa = -10;
		basyo = 0;
		cin >> m >> tibi >> deka;
		if (m == 0) break;
		for (int i = 0; i < m; i++) {
			cin >> data[i];
		}
		for (int i = tibi-1; i < deka; i++) {
			if (sa <= abs(data[i] - data[i + 1])) {
				sa = abs(data[i] - data[i + 1]);
				basyo = i+1;
			}
		}
		cout << basyo << endl;
	}
}


/*
#include <iostream>
#include <algorithm>
#include <math.h>

int kiriage(double a) {
	if ((a - (double)(int)a) > 0) {
		return (int)a + 1;
	}
	else {
		return (int)a;
	}
}

using namespace std;

int main() {
	int count = 0;
	int x, y, s;
	int m;
	int z;
	int mm[1001];
	int zz[1001];
	int n;
	int tuyoi = -100;
	while (true) {
		tuyoi = -100;
		cin >> x >> y >> s;
		if (s == 0) break;
		for (double i = 1; i < s/2; i++) {
			m = kiriage((s - i) * (100+y) / (100 + x));
			z = kiriage(((100+y) * i / (100 + x)));
//			cout << m << z << endl;
			if (tuyoi < m+z) {
				tuyoi = m+z;
			}
		}
		cout << tuyoi << endl;
	}
}*/