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++: #define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

int p[201];

int main()
{
	while(1) {
		int m, nmin, nmax;
		cin >> m >> nmin >> nmax;
		if (!m && !nmin && !nmax) break;
		memset(p, 0, sizeof(p));
		rep(i,0,m) cin >> p[i];

		int ans = 0, d = 0;
		rep(n,nmin,nmax+1) {
			int a = p[n-1] - p[n];
			if (a >= d) {
				ans = n;
				d = a;
			}
		}
		cout << ans << endl;
	}

	return 0;
}

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

#define int long long
#define DEBUG(x) cerr <<#x<<":"<<x<<endl;
#define DEBUG2(x, y) cerr <<#x<<":"<<x<<" "<<#y<<":"<<y<<endl;
#define DEBUG3(x, y, z) cerr <<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl;
#define DEBUGVC(x) cerr <<#x<<": "; for(auto a:x) cerr << a <<" "; cerr << endl;
#define DEBUGMP(x) cerr <<#x<<":"<<endl; for(auto a:x) cerr << a.first <<" "<< a.second << endl;
#define MAX_N (1000006)
#define INF (1LL << 60)
const int MOD = (int)1e9+7;


signed main() {
    while(1) {
        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> p(m);
        for(int i=0; i<m; i++) cin >> p[i];
        sort(p.rbegin(),p.rend());
        vector<pair<int,int>> n;
        for(int i=n_min; i<=n_max; i++) {
            n.push_back(make_pair(p[i-1]-p[i], i));
            //cout << p[i-1]-p[i] <<" "<< i << endl;
        }
        sort(n.rbegin(),n.rend());
        //for(int i=0; i<n.size(); i++) cout << n[0].first <<" "<< n[0].second << endl;
        cout << n[0].second << endl;
    }
}

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

int main(){
  int m, nmin, nmax;
  while(cin >> m >> nmin >> nmax, m || nmin || nmax){
    nmin--;
    nmax--;
    vector<int> v(m);
    
    for(int i = 0; i < m; i++){
      cin >> v[i];
    }

    pair<int, int> ans = make_pair(0, 0);

    for(int i = nmin; i <= nmax; i++){
      if(v[i] - v[i + 1] >= ans.second){
        ans = make_pair(i + 1, v[i] - v[i + 1]);
      }  
    } 
    cout << ans.first << endl;
  }
}

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T> void operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) cin >> e; }

typedef long long ll;
int const inf = 1<<29;

int main() {

  int M, N[2];
  for(; cin >> M >> N[0] >> N[1] && M;) {
    vector<int> vs(M); cin >> vs;
    int maxgap = 0;
    int maxnum = -1;
    REP(num, N[0], N[1] + 1) {
      if(maxgap <= vs[num - 1] - vs[num]) {
        maxgap = vs[num - 1] - vs[num];
        maxnum = num;
      }
    }

    cout << maxnum << endl;
  }
  
  return 0;
}

C++: #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;
int ps[210];
int main(){ _;
  int m,nmin,nmax;
  while(cin>>m>>nmin>>nmax,(m|nmin|nmax)!=0){
    nmin--;nmax--;
    int p;
    REP(i,m)cin>>ps[i];
    int maxGap=0,maxGapIndex;
    for(int i=nmin;i<=nmax;i++){
      int gap=ps[i]-ps[i+1];
      if(gap>=maxGap){
	maxGap=gap;
	maxGapIndex=i;
      }
    }
    cout<<maxGapIndex+1<<endl;
  }
}

C++: #include <cstdio>

int m,nmin,nmax;
int P[205];
int diff[205];

int main(){

    while(scanf("%d%d%d",&m,&nmin,&nmax)&&m&&nmin&&nmax){
        for(int i=1;i<=m;i++) scanf("%d",P+i);
        for(int i=1;i<=m-1;i++) diff[i]=P[i]-P[i+1];

        int ans=nmax,difference=diff[ans];
        for(int i=nmax;i>=nmin;i--)
            if (diff[i]>difference) ans=i,difference=diff[i];

        printf("%d\n",ans);
    }


    return 0;
}