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 <stdio.h>
#include <vector>
#include <algorithm>

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int student = 0;
    int maxN,minN = 0;
    int gap = 0,gapMax = 0,gapnumber  = 0;
    int score[1020] = {0};
    
    while(cin >> student >>minN >>maxN,student+maxN+minN)
    {
        REP(i,student)
        cin >> score[i];
  
    
    FOR(j,minN,maxN+1)
        {
            gap = score[j-1] - score[j];

            if(gapMax <= gap)
            {
                gapnumber = j;
                gapMax = gap;
                
            }
        }
        cout << gapnumber << endl;
        gapMax  =-1;
        gapnumber = 0;
    
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define INF (1<<29)

int main()
{
    int m, nmin, nmax;
    while (cin >> m >> nmin >> nmax, m) {
        vector<int> P(m);
        for (int i = 0; i < m; i++) {
            cin >> P[i];
        } 
        int gap = P[nmin-1] - P[nmin], res = nmin;
        for (int i = nmin; i < nmax; i++) {
            if (gap < P[i] - P[i+1]) {
                gap = P[i] - P[i+1];
                res = i + 1;
            } else if (gap == P[i] - P[i+1]) {
                res = i + 1;
            }
        }
        cout << res << endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  while(1){
        int m,n1,n2,ans,max=0,s,p;
        int a[10000];
        cin >> m >> n1 >> n2;
        if(m==0 && n1==0 && n2==0) break;
        for(int i=0; i<m; i++){
          cin >> p;
          a[i] = p;
        }
        for(int i=n1; i<=n2; i++){
          s = a[i-1] - a[i];
          if(s >= max) {
                ans = i;
                max = s;
          }
        }
        cout << ans << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

std::vector<int> P(10000);

int main() {
    int m, nmin, nmax;
    int i;
    while(std::cin >> m >> nmin >> nmax) {
        if(m == 0 && nmin == 0 && nmax == 0) break;
        for(i=0; i<m; ++i) {
            std::cin >> P[i];
        }
        std::sort(P.begin(), P.begin()+i, std::greater<int>());

        int max = 0;
        int maxN = 0;
        for(i=nmax; i>=nmin; --i) {
            int gap = P[i-1] - P[i];
            if(gap > max) {
                max = gap;
                maxN = i;
            }
        }
        std::cout << maxN << std::endl;
    }
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int main(){

  while(true){
  int n, mn, mx;
  cin >> n >> mn >> mx;

  if(n == 0 && mn == 0 && mx == 0) break;

  vector<int> v(n);
  REP(i,n){
    cin >> v[i];
  }

  //sort(ALL(v), greater<int>());
  int g = 0;
  int ans;
  for(int i = mn; i <= mx && i < n; ++i){
    int tmp = v[i-1] - v[i];
    //cout << i+1 << " " << tmp << " " << g << endl;
    if(tmp >= g){
      g = tmp;
      ans = i;
    }
  }

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int m,s,g,p[200];
  while(cin>>m>>s>>g,m){
    int ans=-1,an;
    for(int i=0;i<m;i++)cin>>p[i];
    sort(p,p+m,greater<int>());
    for(int i=g;i>=s;i--)if(ans<p[i-1]-p[i])ans=p[i-1]-p[i],an=i;
    cout<<an<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
vector<int>ansl;
string s;
int main(){
  int M,N_MIN,N_MAX;

  cin >>M>>N_MIN>>N_MAX;
  while(!((M==0)&&(N_MIN==0)&&(N_MAX==0))){
    vector<int> v;
    for(int i = 0;i<M;i++){
      int x;
      cin >>x;
      v.push_back(x);
    }
    int ans = N_MIN-1;
    int gap = v[N_MIN-1]-v[N_MIN];
    for(int i = N_MIN;i <= N_MAX-1;i++){
      int z = v[i]-v[i+1];
      int mx = gap;
      gap = max(gap,z);
      if(mx != gap){
        ans = i;
      }
      if(mx == z){
          ans = i;
      }
    }
    ansl.push_back(ans+1);
    cin >>M>>N_MIN>>N_MAX;
  }

  for(int i = 0;i<(int)ansl.size();i++){
    cout <<ansl[i]<<endl;
  }
  return 0;
}

C++: #include <cstdio>
#include <cctype>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	for (int m, min, max; m = in(), min = in() - 1, max = in();) {
		vector<int> v(m), w;
		for (int &p: v)
			p = in();
		int j = 0;
		for (int i = min, m = 0; i < max; i++) {
			int t = v[i] - v[i + 1];
			if (t >= m) {
				j = i;
				m = t;
			}
		}
		outl(j + 1);
	}
}

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

int main(){
    int m,min,max,gap,gapmax,n;
    while(cin >> m >> min >> max && m != 0){
        int p[m];
        REP(i,m){
            cin >> p[i];
        }
        gapmax = 0;
        FOR(i,min,max+1){
            gap = p[i-1] - p[i];
            if(gap >= gapmax){
                gapmax = gap;
                n = i;
            }
        }
        cout << n << endl;
    }


}