Go: package main

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

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

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
		}

		score_list := []int{}
		for i := 0; i < m; i++ {
			score_list = append(score_list, nextInt(sc))
		}

		// 最低合格者数と最高合格者数の間の各得点間のギャップが最大になる合格者数を取得する
		scoreGap := 0
		scoreGapMax := 0
		qualifiedNum := 0
		for n := nMin; n <= nMax; n++ {
			scoreGap = score_list[n-1] - score_list[n]
			if scoreGap >= scoreGapMax {
				scoreGapMax = scoreGap
				qualifiedNum = n
			}
		}

		fmt.Println(qualifiedNum)
	}
}

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

using namespace std;

#define INF 1010001000
#define EPS 1e-10
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back

typedef pair<int, int> i_i;
typedef long long int llong;
typedef pair<llong, llong> ll_ll;
typedef struct edge {int f, t;}Edge;


int main()
{
    int m, min, max;
    while (cin >> m >> min >> max, m) {
        vector<int> data(200, 0);
        rep(i, m) {
            cin >> data[i];
        }
        int ans = 0;
        int ret = min;
        for (int i = min; i <= max; i++) {
            if (ans <= data[i-1] - data[i]) {
                ans = data[i-1] - data[i];
                ret = i;
            }
        }
        cout << ret << endl;
    }
    return 0;
}

C++: #include<iostream>
 
using namespace std;
const int MAX_N=1e3;
int data[MAX_N];
int main(){
    int m,nmi,nma;
    while(cin>>m>>nmi>>nma && nmi!=0){
        for(int i=0;i<m;i++)cin>>data[i];
        int ma=0;
        int ans=0;
        for(int i=nmi-1;i<nma;i++){
            if(ma<=data[i]-data[i+1]){
                ans=i+1;
                ma=data[i]-data[i+1];
            }
        }
        cout<<ans<<endl;
    }
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main(void){
    // Your code here!
    
    while(1){
    int m = 0;
    int nMin = 0;
    int nMax = 0;
    
    scanf("%d %d %d",&m,&nMin, &nMax);
    if(m==0 && nMin == 0 && nMax == 0)break;
    
    int p[2100] = { 0 };
    
    for(int i=0;i<m;i++){
        scanf("%d",&p[i]);
    }
    
    int gap = 0;
    int gap_i = 0;
    
    for(int i=0;i<m;i++){
        for(int j=nMin-1;j<nMax;j++){
            if(p[j]-p[j+1]>=gap){
                gap = p[j]-p[j+1];
                gap_i = j+1;
            }
            }
        }
    
    cout << gap_i << endl;
    }
    
    
    return 0;
}

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

// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long double> vld;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T> int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F> int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T> void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C> void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U> void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U> void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C> void reverse(C& c) { reverse(ALL(c)); }
template<typename C> void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred> void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
constexpr int PI = (2*acos(0.0));
constexpr int EPS = (1e-9);
constexpr int MOD = (int)(1e9+7);
constexpr int INF = 100000000;
#pragma endregion


int main()
{
    int m, nmin, nmax;
    while(cin>>m>>nmin>>nmax, m) {
        vi v(m);
        rep(i,m) cin>>v[i];
        sort(v);
        int tmp = 0;
        int ans = 0;
        REPI(i,nmin,nmax) {
            if(v[m-i]-v[m-i-1]>=tmp) {
                tmp = v[m-i]-v[m-i-1];
                ans = i;
            }
        }
        P(ans);
    }
    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
 
using namespace std;
 
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define rep(i,n) REP(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(r) (r).begin(),(r).end()
#define rall(r) (r).rbegin(),(r).rend()
#define fi first
#define se second
#define DBG(X) cout<<" "<<#X<<" : "<<X<<endl
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;

const int INF = 1e9;
const double EPS = 1e-8;
const int mod = 1e9 + 7;
const ll LINF = 1e18;

struct Input
{
	int n;char c;char str[1024];string s;ll l;
	int nextInt(){scanf("%d", &n);return n;}
	ll nextLong(){scanf("%lld", &l);return l;}
	char nextChar(){scanf("%c", &c);return c;}
	string next(){scanf("%s", str);return string(str);}
	string nextLine(){getline(cin, s);return s;}
};
Input in;

int main(){
	while(1){
		int m = in.nextInt(), n1 = in.nextInt(), n2 = in.nextInt();
		if(m == 0) break;
		vi v(m);
		rep(i, m) v[i] = in.nextInt();
		sort(rall(v));
		int ans = n1;
		for(int i = n1; i <= n2; i++){
			if(v[i-1]-v[i] >= v[ans-1] -v[ans]) ans = i;
		}
		cout<<ans<<endl;
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,l,r;
  while(cin>>n>>l>>r&&n) {
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a,a+n,greater<int>());
    int x,M=0;
    for(int i=l-1;i<r;i++) {
      if(M<=a[i]-a[i+1]) {
        M=a[i]-a[i+1];
        x=i+1;
      }
    }
    cout << x << endl;
  }
  return 0;
}

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

int main(int argc, char *argv[])
{
  int m, min, max;

  while(cin >> m >> min >> max, m) {
    vector<int> v;
    for (int i = 0; i < m; i++) {
      int P;
      cin >> P;
      v.push_back(P);
    }

    int maxgap = 0, answer = 0;
    for (int i = min; i < max+1; i++) {
      int gap = v[i-1] - v[i];
      //cout << gap << endl;
      if(maxgap<=gap) {
	maxgap = gap;
	answer = i;
      }
    }

    cout << answer << endl;

  }
  
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int a[201];
int main(){
    int m,mx,mn;
    while(cin>>m>>mn>>mx,m){
        rep(i,m) cin>>a[i];
        sort(a,a+m,greater<int>());
        int cnt=0,x=0;
        FOR(i,mn-1,mx){
            if(x<=a[i]-a[i+1]) cnt=i,x=a[i]-a[i+1];
        }
        cout<<cnt+1<<endl;
    }
    return 0;
}