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<bits/stdc++.h>
using namespace std;

int main(){

  int nmin,nmax,m;
  vector<int> point(0);
  int gap,ans;

  while(cin>>m>>nmin>>nmax , nmin&&nmax&&m){
    point.resize(m);
    gap = 0;
    
    for(int i=0; i<m; i++)cin >> point[i];

    sort(point.begin(),point.end());
    reverse(point.begin(),point.end());

    //for(int i=0;i<point.size();i++)cout << point[i]<<' ';
    
    for(int i=nmin-1; i<nmax; i++){
      if(point[i]-point[i+1] >= gap){
	gap = point[i]-point[i+1];
	ans = i+1;
      }
    }

    cout << ans << endl;

  }


  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
 
int main()
{
  int m, small, big, P[201];
 
  while(cin >> m >> small >> big, m) {
    for(int i = 1; i <= m; i++) {
      cin >> P[i];
    }
    int calc = 0;
    for(int i = big; i >= small; i--) {
      calc = max(calc, P[i] - P[i + 1]);
    }
    for(int i = big; i >= small; i--) {
      if(calc == P[i] - P[i + 1]) {
        cout << i << endl;
        break;
      }
    }
  }
  return(0);
}

C++: #include<bits/stdc++.h>
 
using namespace std;
 
#define rep(i, n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define pb push_back
 
int main(){
    int x,y,z;
    while(1){
        cin>>x>>y>>z;
 
        if(x==0&&y==0&&z==0)break;
 
 
        int a[114514];
        int b[114514];
 
        rep(i,x){
            cin>>a[i];
        }

        rep(i,z-y+1){
            b[i]=a[i+y-1]-a[i+y];
        }

        rep(i,z-y+1){
            // cout<<i<<" "<<b[i]<<endl;
        }

        int count=0;
        int tmp=0;
        int ans=0;

        for(int i=0;i<z-y+1;i++){
            if(tmp<b[i]){
                tmp=b[i];
                ans=i+2;
            }
        }
        cout<<ans<<endl;
 
       
    //     repi(i,y-1,z){
    //         // cout<<a[i]<<endl;
    //         // cout<<a[i+1]<<endl;
             
    //         if(tmp<=a[i]-a[i+1]){
    //             tmp=max(tmp,a[i]-a[i+1]);
    //             ans=i-1+y;
    //         }
 
    //         // cout<<"tmp:"<<tmp<<endl;
    //         // cout<<"ans:"<<ans<<endl;
 
    //         count++;
    //     }
    //     // cout<<count<<endl;
    //     // cout<<"tmp:"<<tmp<<endl;
    //     // cout<<"ans:"<<ans<<endl;
    //     if(y==1){
    //         cout<<ans+1<<endl;
    //     }else{
    //         cout<<ans<<endl;
    //     }
 
    }
     
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

int m,nmin,nmax;
int a[1111];

int main(){
	cin.sync_with_stdio(false);
  while(cin>>m>>nmin>>nmax){
    if(m==0)break;
    rep(i,m)cin>>a[i];
    sort(a,a+m);
    reverse(a,a+m);
    int gap=0,res=-1;
    repl(i,nmin-1,nmax){
      if(gap<=a[i]-a[i+1]){
        gap=a[i]-a[i+1];
        res=i+1;
      }
    }
    cout<<res<<endl;
  }
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << '\n';
typedef int64_t Int;
Int mod = 1e9+7;
Int INF = 1e9+7;

int main() {
    while (true) {
        Int m, nmin, nmax;
        cin >> m >> nmin >> nmax;
        if (m == 0) break;
        vector<Int> p(m + 1);
        for (Int i = 1; i <= m; i++) {
            cin >> p[i];
        }
        Int ma = -1e9;
        Int index = 1;
        for (Int i = nmin; i <= nmax; i++) {
            if (p[i] - p[i + 1] >= ma) {
                ma = p[i] - p[i + 1];
                index = i;
            }
        }
        dump(index);
    }
    return 0;
}

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

int main() {
    int n, nmin, nmax;
    while (cin >> n >> nmin >> nmax, n) {
        vector<int> P(n);
        for (int i = 0; i < n; ++i) cin >> P[i];

        int diff = 0;
        int res = -1;
        for (int i = nmin - 1; i <= nmax - 1; ++i) {
            if (diff <= P[i] - P[i + 1]) {
                diff = P[i] - P[i + 1];
                res = i + 1;
            }
        }
        cout << res << endl;
    }
    return 0;
}

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

int main(){
	while(true){
		int m,nmin,nmax;
		cin>>m>>nmin>>nmax;

	if(m==0 && nmin==0 && nmax==0){
		break;
	}

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

	int gap = -1;
	int n = -1;
	
	for(int i=nmin;i<=nmax;i++){
		int g = P[i-1]-P[i];

		if(gap<=g){
			gap =g;
			n=i;
		}
	}
	cout<< n<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int a = 0, b = 0, c = 0;
	while (1)
	{
		int e = 0;
		int f = 0;
		cin >> a >> b >> c;
		if (a == 0 && b == 0 && c == 0)
		{
			break;
		}
		int d[200];
		for (int i = 0; i < a; i++)
		{
			cin >> d[i];
		}
		sort(d, d + a);
		for (int i = b; i <= c; i++)
		{
			if (d[a - i] - d[a - i - 1] >= e)
			{
				e = d[a - i] - d[a - i - 1];
				f = i;
			}
		}
		cout << f << endl;
	}
return 0;
}

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; i <= nmax; i++) {
			
			if (s < score[i ] - score[i+1]) {
				ans = max(ans,i);
				s = max(s, score[i ] - score[i+1]);
				
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
	int m,nmin,nmax;
	while(cin>>m>>nmin>>nmax and m>0){
		int p[m]; rep(i,m) cin>>p[i];
		sort(p,p+m); reverse(p,p+m);

		int ans=nmin,gap=0;
		for(int n=nmin-1;n<nmax;n++){
			if(p[n]-p[n+1]>=gap){
				gap=p[n]-p[n+1];
				ans=n+1;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

int main(){
	while (true) {
		int m,nmin,nmax;
		cin>>m>>nmin>>nmax;

		if (m==0&&&nmin==0&&nmax==0) break;

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

		int gap=-1;
		int n=-1;

		for (int i = 0; i < m; i++) {
			int g=P[i-1]-P[i];

			if(gap<=g){
				gap=g;
				n=i;
			}
		}
		cout<<n<<endl;
	}
	return 0;
}

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

typedef long long ll;
typedef pair<int,int> P;

int m,nmin,nmax;
int p[100001];

int main(void){
	while(1){
		scanf("%d%d%d",&m,&nmin,&nmax);
		if(m==0 && nmin==0 && nmax==0)break;
		for(int i=1;i<=m;i++){
			scanf("%d",&p[i]);
		}
		sort(p,p+m+1);
		int val=-1,res=-1;
		for(int i=nmin;i<=nmax;i++){
			if(p[m-i+1]-p[m-i]>=val){
				res=i;
				val=p[m-i+1]-p[m-i];
			}
		}
		printf("%d\n",res);
	}
	return 0;
}