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<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
using namespace std;
#define mod (1000000000+7)
#define N (10007)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;


int main(void){
	int m,n1,n2;
	while(true){
		cin>>m>>n1>>n2;
		if(m==0 && n1==0 && n2==0)break;
		vector<int>p(m);
		for(int i=0;i<m;i++)cin>>p[i];
		sort(p.begin(),p.end(),greater<int>());
		int ans=0,index=-1;
		for(int i=n1-1;i<n2;i++){
			if(p[i]-p[i+1]>=ans){
				ans=p[i]-p[i+1];
				index=i;
			}
		}
		cout<<index+1<<endl;
	}
    return 0;
}

C++: //
//  main.cpp
//  Entrance Examination
//
//  Created by x15071xx on 2017/06/15.
//  Copyright ?? 2017??´ AIT. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;

int main(int argc, const char * argv[]) {
    
    while(1){
        
        int m,nmin,nmax;
        vector<int> score;
        vector<int> gap;
        
        cin >> m >> nmin >> nmax;
        
        if (m == 0 && nmin == 0 && nmax == 0) {
            break;
        }
        int tmp;
        for (int i = 0; i < m; i++) {
            cin >> tmp;
            score.push_back(tmp);
        }
        
        
        for (int i = nmin-1; i < nmax; i++) {
            gap.push_back(abs(score[i]-score[i+1]));
        }
        
        nmax = -1;
        for (int i = 0; i < gap.size(); i++) {
            if (gap[nmax] <= gap[i]) {
                nmax = i;
            }
        }
        
        cout << nmin+nmax << endl;
        
    }
    return 0;
}

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

int main(void) {
    int m, nmin, nmax;
    vector<int> p(201);
    while(cin >> m >> nmin >> nmax && m) {
        REP(i, m) scanf("%d", &p[i]);
        sort(p.begin(), p.end(), greater<int>());
        int ans, gap = 0;
        for(int i=nmin-1; i<nmax; ++i) {
            if(p[i]-p[i+1] >= gap) {
                gap = p[i]-p[i+1];
                ans = i+1;
            }
        }
        cout << ans << endl;
    }
}

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

int main(){
    int m, nmin, nmax;
    while(cin >> m >> nmin >> nmax, m != 0){
        vector<int> v;
        for(int i=0;i<m;++i){
            int p;
            cin >> p;
            v.push_back(p);
        }
        sort(v.rbegin(), v.rend());
        int maxi = 0, n = 0;
        for(int i=nmin-1;i<nmax;++i){
            if(v[i] - v[i+1] >= maxi){
                maxi = v[i] - v[i+1];
                n = i + 1;
            }
        }
        cout << n << endl;
    }

    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int a,min,max,p,mmax=0,mm,i,b;
    while(1){
        mmax=0;
        cin>>a>>min>>max;
        if(a==min && min==max && a==0) break;
        for(i=0;i<a;i++){
            cin>>p;
            if(i>=min && i<max+1){
                if(mm-p>=mmax) {
                    mmax=mm-p;
                    b=i;
                //  cout<<mm<<" "<<p<<" "<<mmax<<endl;
                }
            }
            mm=p;
        }
        cout<<b<<endl;
    }
    return 0;
}

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

int main(){
  int n,a,b,x[200];
  while(1){
    cin>>n>>a>>b;
    if(n==0 && a==0 && b==0) break;
    for(int i =0;i<n;i++){
      cin>>x[i];
    }
    int j=0,k=a;
    for(int i=a-1;i<b;i++){
      if(x[i]-x[i+1]>=j){
	j=x[i]-x[i+1];
	k=i+1;
      }
    }
    cout<<k<<endl;
  }
  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int p[200];
int main() {
	int m, s, g;
	while (scanf("%d%d%d", &m, &s, &g), m) {
		rep(i, m)scanf("%d", &p[i]);
		sort(p, p + m, greater<>());
		int Max = 0, cnt;
		for (int i = s - 1; i < g; i++) {
			if (p[i + 1] - p[i] >= Max) {
				Max = p[i + 1] - p[i];
				cnt = i + 1;
			}
		}
		printf("%d\n", cnt);
	}
}

C++: #include <iostream>
#include <utility>
#include <vector>

using namespace std;

int main()
{
    while (true) {
        int m;
        int nMin;
        int nMax;
        cin >> m >> nMin >> nMax;

        if (m == 0 && nMax == 0 && nMin == 0) {
            break;
        }

        vector<int> v;
        for (int i = 0; i < m; ++i) {
            int p;
            cin >> p;
            v.push_back(p);
        }

        auto maximum = make_pair(0, -1);
        for (int n = nMin; n <= nMax; ++n) {
            auto gap = v[n - 1] - v[n];
            if (maximum.second <= gap) {
                maximum = make_pair(n, gap);
            }
        }
        cout << maximum.first << endl;
    }
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
#include<random>
using namespace std;

int main()
{
	int n, l, r, curr, pre;
	
	vector<int> ans;
	while (1)
	{
		cin >> n >> l >> r;
		vector<int> m(n);
		if (n == 0 && l == 0 && r == 0) break;
		int max = 0;
		pre = 0;
		for (int i = 0; i < n; ++i)
			cin >> m[i];
		int diff = 0;
		for (int i = 0; i < r - l + 1; ++i)
		{
			if (diff <= m[i + l - 1] - m[i + l])
			{
				diff = m[i + l - 1] - m[i + l];
				max = i + l;
			}
		}
		ans.push_back(max);
	}
	for (const auto& a : ans)
		cout << a << endl;
	return 0;

}

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

int main(){
	while(1){
		int m,n1,n2;//n2は最大人数
		cin>>m>>n1>>n2;

		if(m==0&&n1==0&&n2==0)
			break;
		
		int P[200];
		for(int i=0;i<m;i++){
			cin>>P[i];
		}
		
		int gap=-1;
 		int n=-1;

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

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

		cout<<n<<endl
	}
	
	return 0;
}

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

#define rep(i,n) for (int i = 0; i < (n); ++i)

inline void init() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int m, nmin, nmax, ans, dif;
int tester[205];

int main(void) {
    init();

    while (cin >> m >> nmin >> nmax, m | nmin | nmax) {
        memset(tester, 0, sizeof(tester));
        ans = dif = -1;
        rep (i,m) cin >> tester[i];

        sort(tester, tester + m, greater<int>());

        for (int i = nmin; i <= nmax; ++i) {
            int tmp = tester[i-1] - tester[i];
            if (dif <= tmp) {
                ans = i;
                dif = tmp;
            }
        }
        cout << ans << endl;
        /*rep(i,m) {
            cout << tester[i] << endl;
        }*/
    }
    return 0;
}