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;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
const ll mod = ll(1e9) + 7;
const int INF = int(1e9);
int main()
{
	vector<int> ans_list;
	while (1)
	{
		int m;
		cin >> m;
		int n_min, n_max;
		if (m == 0)
			break;
		cin >> n_min >> n_max;
		n_min--;
		n_max--;
		vector<int> p(m);
		for (int i = 0; i < m; i++)
		{
			cin >> p[i];
		}
		sort(p.begin(), p.end(), greater<int>());
		int ans = 0, gap = 0;
		for (int i = n_min; i <= n_max; i++)
		{
			if (gap <= p[i] - p[i + 1])
			{
				gap = p[i] - p[i + 1];
				ans = i + 1;
			}
		}
		ans_list.push_back(ans);
	}
	for (int i = 0; i < ans_list.size(); i++)
		cout << ans_list[i] << endl;

	return 0;
}

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

int main(){
	while (ture) {
		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=il;
			}
		}
		cout<<n<<endl;
	}
	return 0;
}

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

int main(){
  int n_max,n_min,m;
  while(cin >> m >> n_min >> n_max,m!=0){
    vector<int> v;
    int m_gyap=0;
    int ans;
    
    for(int i=0; i<m; ++i){
      int tmp;
      cin >> tmp;
      v.push_back(tmp);
    }

    for(int i=n_min-1; i<n_max; ++i){
      int tmp;
      tmp = v[i] - v[i+1];
      if(m_gyap <= tmp){
	m_gyap = tmp;
	ans = i+1;
	//cout << "gyap is " << v[i] << " to " << v[i+1] << endl;
      }
    }

    cout << ans << endl;
  }
  return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#define rep(i, n) for(int i = 0;i < n;i++)
#define repb(i, n) for(int i = n;i >= 0;i--)
#define reps(i, m, n) for(int i = m;i < n;i++)
#define repsb(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;


int main(){
	int m,mi,mx,n,d;
	while(1){
		cin>>m>>mi>>mx;
		if(m==0&&mi==0&&mx==0)	break;
		int p[10000];
		rep(i,m){
			cin>>p[i];
		}
		sort(p,p+m);
		n=0;
		repsb(i,mx,mi){
			if(d<p[i]-p[i-1]) n=i;
			d=max(d,p[i]-p[i-1]);
		}
		cout<<n<<endl;
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
typedef unsigned int ui;
int main(){
	int m, ni, na,p;
	while (cin >> m >> ni >> na) {
		if (m == 0)break;
		int ma = 0; int check; int memo = 0;
		for (int i = 1; i <= m; i++) {
			if (i == 1) {
				cin >> p; memo = p; continue;
			}
			cin >> p;
			if (ni < i && i <= na+1) {
				if (ma <= memo - p) {
					ma = memo - p; check = i - 1;
				}
			}
			memo = p;
		}
		cout << check << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <valarray>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <list>
#include <limits>
#include <numeric>
#include <utility>
#include <deque>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#include <array>
#include <bitset>
#include <complex>
#include <tuple>
#include <random>

using namespace std;
using ll = long long;
const int INF = 1e9;
const ll MOD = 1e9 + 7;

int main()
{
  int m, nmin, nmax;
  while (cin >> m >> nmin >> nmax, m || nmin || nmax)
  {
    vector<int> p(m);
    for (auto &e : p)
      cin >> e;
    sort(p.begin(), p.end(), greater<int>());
    int ans = 0, gap = 0;
    for (int n = nmin; n <= nmax; ++n)
    {
      if (gap <= p[n - 1] - p[n])
      {
        gap = p[n - 1] - p[n];
        ans = n;
      }
    }
    cout << ans << endl;
  }

  return 0;
}

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

int main() {
 int m,a,b;
  while( cin>>m>>a>>b && m > 0 || a > 0 || b > 0){
    
    vector<int>vec(m);
    for(int i=0;i<m;i++){
      cin>>vec.at(i);
    }
    int ans=0;
    int num;
    
    
    for(int i=a;i<=b;i++){
   
     if(vec.at(i-1)-vec.at(i) >=ans){
       ans=vec.at(i-1)-vec.at(i);
       num =i;
     }
    }
    cout << num << endl;
  }
  return 0;
}

C++: #include <stdio.h>
int main(){
	int m,a,b,x,y,r,g,i;
	for(;scanf("%d%d%d%d",&m,&a,&b,&x)>3;){
		for(g=0,i=1;i<m;i++){
			scanf("%d",&y);
			if(a<=i&&i<=b && x-y>=g)g=x-y,r=i;
			x=y;
		}
		printf("%d\n",r);
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main(){
  int m,nmin,nmax;
  while(cin>>m>>nmin>>nmax,m+nmin+nmax!=0){
    vector<int> point(m);
    for(int i=0;i<m;i++)
      cin>>point[i];
    int max=-1,ans=0;
    for(int i=nmin-1;i<nmax;i++){
      if(max<=(point[i]-point[i+1])){
	max=point[i]-point[i+1];ans=i+1;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define POF pop_front
#define POB pop_back
#define MA make_pair
#define ll long long
#define VE vector<int>
#define VP vector<pair<int,int> >
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=1e9+7;
//
int main(){
  int M,mi,ma;
  int P[200];
  while(1){
    cin>>M>>mi>>ma;
    if(M==0){
      break;
    }
    FOR(i,0,M){
      cin>>P[i];
    }
    int cnt=0,ans;
    FOR(i,mi-1,ma){
      if(cnt<=P[i]-P[i+1]){
        cnt=P[i]-P[i+1];
        ans=i+1;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}