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 m,mn,mx;
  int gap;
  int pass;
  while(1){
    gap=0;
    pass=0;
    cin>>m>>mn>>mx;
    if(m==0 && mn==0 & mx==0) break;
    int score[m];
    for(int i=0;i<m;i++){
      cin>>score[i];
    }
    for(int i=mn;i<=mx;i++){
      if(gap<=score[i-1]-score[i]){
	gap=score[i-1]-score[i];
	pass=i;
      }
      cout<<pass<<" "<<gap<<endl;
    }
    cout<<pass<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <ctime>
#define INF 999999999
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=(n);i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define MOD(x) (x%(mod))
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;
/*---------------------------------------------------*/

int main(){
  int m,mini,maxi,gap,ans;
  int data[200];
  while(cin>>m>>mini>>maxi){
    if(m==0&&mini==0&&maxi==0)break;
    rep(i,m)cin>>data[i];
    ans=mini;gap=0;
    for(int i=mini-1;i<=maxi-1;i++){
      if(abs(data[i]-data[i+1])>=gap){
	gap=abs(data[i]-data[i+1]);
	ans=i+1;
      }
    }
    cout<<ans<<endl;
  }
}

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

int main (){
	int n,min,max;
	while(cin>>n>>min>>max && n){
		min--; max--;
		vector<int> v(n);
		for(int i=0;i<n;i++)cin>>v[i];
		sort(v.begin(),v.end(),greater<int>());

		int ans,gap=0;
		for(int i=min;i<=max;i++){
			if(gap>=v[i+1]-v[i]){
				gap=v[i+1]-v[i];
				ans=i+1;
			}
		}
		cout<<ans<<endl;
	}
}

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 <vector>
#include <cmath>
#include <algorithm>
#include <functional>

using namespace std;

int main() {
	int n, m1, m2;
	while (cin >> n >> m1 >> m2) {
		if (n == 0 && m1 == 0 && m2 == 0) {
			break;
		}
		vector<int> p(n);
		for (int i = 0; i < n; i++) {
			cin >> p[i];
		}
		int ans = m1;
		int ansn = p[m1-1]-p[m1];
		for (int i = m1; i <= m2; i++) {
			if (p[i-1] - p[i] >= ansn) {
				ansn = p[i-1] - p[i];
				ans = i;
			}
			//cout << ans << ' ' << ansn << endl;
		}
		cout << ans << endl;
	}
	return 0;
}

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

int main() {
	int n, nmin, nmax;
	int a[500];
	int b[500];
	int c[3];
	int gapmax = -100;
	int gap;
	int pass;

	a[0] = 0;
	b[0] = 0;
	c[0] = 0;

	while (1) {
		cin >> n >> nmin >> nmax;

		if (n == 0 && nmin == 0 && nmax == 0) { 
			break; 
		}
		pass = 0;
		gapmax = -100;

		for (int i = 1; i < n + 1; i++) {
			cin >> a[i];
		}
		for (int i = 1; i < n + 1;i++){
			b[i] = a[i] - a[i + 1];
			}
		for (int i = nmin; i < nmax+1; i++) {
			if (gapmax<=b[i]){
				gapmax= b[i];
				pass = i;
			}
			
		}
		cout << pass << endl;	
	}	
}

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

#define reps(i,j,k) for(int i=(j);i<(k);i++)
#define rep(i,j) reps(i,0,j)
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main(){
	int m, ni,na;
	while(cin >> m >> ni >> na, m){
		vi p(m);
		rep(i,m){
			cin >> p[i];
		}
		int ans = -1, gap = -1;
		reps(i, ni, na+1){
			int g = p[i-1] - p[i];
			if(gap <= g){
			  ans = i;
			  gap = g;
			}
		}
		cout << ans << endl;
	}
}

C++: #include "bits/stdc++.h"

#define REP(i,n) for(int i=0;i<n;++i)
#define RREP(i,n) for(int i=n-1;i>=0;--i)
#define FOR(i,m,n) for(int i=m;i<n;++i)
#define RFOR(i,m,n) for(int i=m-1;i>=n;--i)
#define ALL(v) v.begin(),v.end()
#define PB(a) push_back(a)
#define INF 1000000001
#define MOD 1000000007

using namespace std;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int m, minn, maxn;
	while (1) {
		cin >> m >> minn >> maxn;
		if (!m) break;
		vector<int> v(m);
		REP(i, m) {
			cin >> v[i];
		}
		int gap = -INF, ans = 0;
		FOR(i, minn, maxn + 1) {
			if (gap <= v[i - 1] - v[i]) {
				gap = v[i - 1] - v[i];
				ans = i;
			}
		}
		cout << ans << endl;
	}
	return 0;
}

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

using namespace std;

typedef long long  ll;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int m, min_n, max_n;

    while (cin >> m >> min_n >> max_n, m) {
        vector<int> p(m);
        for (int i = 0; i < m; ++i)
            cin >> p[i];
        sort(p.begin(), p.end(), greater<int>());

        int n = 0, gap = 0;
        for (int i = min_n; i <= max_n; ++i) {
            int tmp_gap = p[i - 1] - p[i];
            if (gap <= tmp_gap) {
                gap = tmp_gap;
                n = i;
            }
        }

        cout << n << endl;
    }

    return 0;
}

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

#define ll long long

using namespace std;


int m,Nmin,Nmax;

int P[205]={};
int ans;

int main(){

    while(1){
        scanf("%d %d %d",&m,&Nmin, &Nmax);
        if(m == 0 && Nmin == 0 && Nmax == 0) break;

        for(int i=0;i<m;i++){
            scanf("%d",&P[i]);
        }
        int max_gap;

        for(int i=Nmin-1;i<Nmax;i++){
            int gap = P[i] - P[i+1];
            if(max_gap <= gap){
                max_gap = gap;
                ans = i+1;
            }
        }
        printf("%d\n",ans);
    }


}

C++: #include<bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n ; i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x) // decltypeで型取得、引数があればva_argsのところに入れる
using namespace std;
typedef long long ll; // long longをllでかけるようにした
const int INF = 1e9;

int main(void){
    while(true){
        int n, nMax, nMin; cin >> n >> nMin >> nMax;
        if(n == 0 and nMax == 0 and nMin == 0) return 0;
        else{
            vector<int> score(n);
            REP(i, n) cin >> score[i];
            int ans = 0, gap = 0;
            FOR(i, nMin, nMax + 1){
                if(score[i - 1] - score[i] >= gap){
                    gap = score[i - 1] - score[i];
                    ans = i;
                }
            }
            cout << ans << endl;
        }
    }
}