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 <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;
	}
}*/

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

#pragma GCC optimize "O3"
#define rep(i,a,n) for(long long i=a; i<n; i++)
typedef long long ll;
typedef pair<int,int> P;
const ll MOD = (int)1e9+7;
const ll INF = MOD*MOD;
const double EPS = 1e-9;
const ll powll = 1LL<<1;

int main(void){
   int m, nmin, nmax;
   
   while(1){
        cin >> m >> nmin >> nmax;
        if(m == 0) break;
        int ans = 0;
        int dif = 0;
        int p[m];
        rep(i,0,m){
            cin >> p[i];
        }
        sort(p,p+m);
        rep(i,nmin, nmax+1){
            int pmin = MOD;
            int pmax = 0;
            rep(j,0,m-i){
                pmax = max(pmax,p[j]);
            }
            rep(j,m-i, m){
                pmin = min(pmin, p[j]);
            }
            if((pmin-pmax) >= dif && i > ans){
                dif = pmin-pmax;
                ans = i;
            }
        }
        cout << ans << "\n";
   }
}