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 <cstdio>
#include <cstdlib>
#include <math.h>
#include <algorithm>
using namespace std;

int m,nmin,nmax,ten[205],gap,ans;

int main(){
while(1){
	
	
	scanf("%d %d %d",&m,&nmin,&nmax);
	if(m + nmin + nmax == 0)break;
	for(int i = 0;i < m;i++){
		scanf("%d",&ten[i]);
	}
	gap = -1;
	for(int i = nmin - 1;i < nmax ;i++){
		if(ten[i] - ten[i+1] >= gap){
			ans = i + 1;
			gap = ten[i] - ten[i+1];
		}
	}
	
	printf("%d\n",ans);
	
}

return 0;

}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
int tx[] = {0,1,0,-1};
int ty[] = {-1,0,1,0};

int main(){
  int num_student;
  int num_min_pass;
  int num_max_pass;
  while(~scanf("%d %d %d", &num_student, &num_min_pass, &num_max_pass)) {
    if (num_student == 0) break;

    int score[10000];
    for (int student_i = 0; student_i < num_student; student_i++) {
      scanf("%d", &score[student_i]);
    }
    sort(score,score + num_student, greater<int>());
    int diff = -1;
    int res = 0;
    for (int pass_i = num_min_pass - 1; pass_i < num_max_pass; pass_i++) {
      int min_pass_score = score[pass_i];
      int max_fail_score = score[pass_i + 1];
      if (diff <= min_pass_score - max_fail_score) {
	diff = min_pass_score - max_fail_score;
	res = pass_i + 1;
      }
    }
    printf("%d\n",res);
  }
}

C++: #include <iostream>
#include<stdio.h>
using namespace std;
int main(void){
    int m,max,min,p[1000];
    while(1){
        int n=0;
        scanf("%d %d %d",&m,&min,&max);
        if(m==0&&max==0&&min==0){
            break;
        }
        for(int i=1;i<m+1;i++){
            cin>>p[i];
        }
        for(int i=max;i>=min;i--){
            if(n<p[i]-p[i+1]){
                n=p[i]-p[i+1];
            }
        }
        for(int i=max;i<=min;i--){
            if(n==p[i]-p[i+1]){
                cout<<i<<endl;
                
            }
        }        
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int m;
vector<int>p;
vector<int>s;
int maxn,minn;


int main(){
  int i,j,now=0,ni=0;
  while(1){
  cin >> m >> minn >> maxn;
  now = 0;
  if(m==0&&maxn==0&&minn==0)break;
  for(i=0;i<m;i++){
    cin >> j;
    p.push_back(j);
  }
  sort(p.begin(),p.end());
  for(i=0;i<m-1;i++)  s.push_back(p[i+1]-p[i]);
  for(i=m-minn-1;i>=m-maxn-1;i--){
    // cout << " bbb"<<s[i];
    if(s[i]>=now){
      now = s[i];
      ni = i;
      //cout <<"aaa"<< now << " "<< ni << endl;
    }
  }
  //cout <<endl<< ni << endl;
  cout << m-1-ni << endl;
  while(p.size())p.pop_back();
  while(s.size())s.pop_back();
  }
  return 0;
}

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

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

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

using namespace std;
int main(){
	while(1){
		int m,nmin,nmax; cin >> m >> nmin >> nmax;
		if (m + nmin + nmax == 0) break;
		int dis = 0;
		int max = 0;
		int maxi = 0;
		int pre_p = 0;
		for (int i = 1; i <= m; i++){
			int p1; cin >> p1;
			if (nmin < i and i <= nmax + 1){
				dis = pre_p - p1;
				if (max <= dis){
					max = dis;
					maxi = i;
				}		
			}
			pre_p = p1;
		}
		cout << maxi - 1 << endl;
	}
return 0;
}

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

#define INF 100000

using namespace std;

int main()
{

    while (true) {
        int m, n_min, n_max;
        cin >> m >> n_min >> n_max;
        if (m==0 && n_min ==0 && n_max == 0) {
            return 0;
        }
        vector<int> pv(m);
        for (int i = 0; i < m; i++) {
            cin >> pv[i];
        }
        sort(pv.rbegin(), pv.rend());
        int d_max = -INF;
        int result = n_min;
        for (int n = n_min; n <= n_max; n++) {
            int d = pv[n - 1] - pv[n];
            if (d >= d_max) {
                d_max = d;
                result = n;
            }
        }
        cout << result << endl;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
  while(true){
  int m,nmin,nmax;
  cin >> m >> nmin >> nmax;
  if(m==0)break;
  int list[m];
  for(int i=0;i<m;i++){
    cin >> list[i];
  }
  int gap=0,c;
  for(int i=nmin-1;i<nmax;i++){
    if(list[i]-list[i+1]>=gap){
      gap=list[i]-list[i+1];
      c=i+1;
    }
  }
  cout << c << 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 <bits/stdc++.h>
using namespace std;
using ll = long long;

signed
main(){
	int m,n,l;
			while(cin >> m >> n >> l && !(m==0 && n==0 && l==0))
			{
					vector<int> p(m);
					for(int i=0;i<m;i++)
							cin >> p[i];

					sort(p.rbegin(), p.rend());
					int ans = 0, sum = 0;;

					for(int i=n;i<=l;i++)
					{
							if(sum <= p[i-1]-p[i])
							{
								ans = i;
								sum = p[i-1] - p[i];
							}
					}
					cout << ans << endl;
			}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> answer;
  while(1){
    int m,n_min,n_max,gap_max = 0,ans;
    cin >> m >> n_min >> n_max;
    if(!m)break;
    vector<int> point(m);
    for(int i = 0;i < m;i++)cin >> point[i];
    sort(point.begin(),point.end());
    for(int i = m-n_max;i <= m-n_min;i++){
      if(point[i] - point[i-1] > gap_max){
        ans = m-i;
        gap_max = point[i] - point[i-1];
      }
    }
    answer.push_back(ans);
  }
  for(int i = 0;i < answer.size();i++)cout << answer[i] << endl;
}

C++: #include <iostream>

using namespace std;

int main() {
    int p[201], ans, t;
    int m, n_min, n_max;

    while (cin >> m >> n_min >> n_max) {
        if (m == 0 && n_min == 0 && n_max == 0) { break; }

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

        ans = 0; t = 0;

        for (int i = n_min; i <= n_max; i++) {
            if (t <= p[i-1] - p[i]) {
                ans = i;
                t = p[i-1] - p[i];
            }
        }
        cout << ans << endl;
    }
    return 0;
}