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>
#include <cstdio>
#include <vector>
#include <algorithm>
#define ll long long
#define all(a) (a).begin(),(a).end()

int main(int argc, char const *argv[]) {
  while(1){
    int m=0,nmin=0,nmax=0;
    scanf("%d%d%d",&m,&nmin,&nmax);
    if(m==0 && nmin==0 && nmax==0){
      break;
    }
    std::vector<int> p(m+1);
    for (int i = 1; i <= m; i++) {
      scanf("%d",&p[i]);
    }
    int temp=0,memo=0,memoid=0;
    for (int i = nmin; i <= nmax; i++) {
      temp=p[i]-p[i+1];
      memo=std::max(memo,temp);
      if(memo==temp) memoid=i;
    }
    p.erase(all(p));
    printf("%d\n",memoid);
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;
int m, nmin, nmax;

int main() {
    while(cin >> m >> nmin >> nmax, m&&nmin&&nmax){
        vector<int> v;
        int maxV=0;
        for(int i=0; i<m; ++i){
            int a; cin >> a; v.push_back(a);
        }
        int index=0;
        for(int i=nmin; i<=nmax; ++i){
            int temp = v[i-1]-v[i];
            if(maxV <= temp){
                index = i; maxV = temp;
            }
        }
        cout << index << endl;
    }
    return 0;
}

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

int main(void){
	int m, n_min, n_max, n;
	while(true){
		cin >> m >> n_min >> n_max;
		if(!m&&!n_min&&!n_max) break;
		vector<int> p(m);
		for(int i = 0; i < m; ++i){
			cin >> p[i];
		}
		sort(p.rbegin(), p.rend());
		int gap = 0, ans;
		for(n = n_min; n <= n_max; ++n){
			gap = max(gap, p[n-1] - p[n]);
			if(gap == p[n-1] - p[n]) ans = n;
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl '\n'
int mod=1e9+7;
int mod2=998244353;

signed main(){
  while(true){
    int n,nmin,nmax;
    cin>>n>>nmin>>nmax;
    if(!n&&!nmin&&!nmax)return 0;
    vector<int> p(n);
    for(int i=0;i<n;i++)cin>>p[i];
    int diff=-1;
    int id;
    for(int i=nmin-1;i<nmax;i++){
      if(abs(p[i]-p[i+1])>=diff){
        diff=abs(p[i]-p[i+1]);
        id=i;
      }
    }
    cout<<id+1<<endl;
  }
}

C++: #include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <fstream>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
typedef long long ll;

#define INF 1000000000

int main(){
    int m,mi,mx;
    while(cin>>m>>mi>>mx, m){
        vector<int> p(m);
        rep(i,m) cin>>p[i];

        sort(all(p), greater<int>());

        int n, gap=0;

        for(int i=mi-1; i<mx; i++){
            if(p[i]-p[i+1] >= gap){
                n=i+1;
                gap = p[i]-p[i+1];
            }
        }
        cout<<n<<endl;
    }

  return 0;
}

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

int main(){
  int m,nmin,nmax,dmax,num;

  while(true){
    cin >> m >> nmin >> nmax;
    if(m == 0 && nmin == 0 && nmax == 0) break;

    int *score = new int[m];

    for(int i = 0; i<m; ++i)
      cin >> score[i];
    
    
    for(int i=nmin - 1; i<nmax; ++i){
      if(i == nmin - 1) dmax = score[i] - score[i+1];
      
      if(score[i] - score[i+1] >= dmax){
	dmax = score[i] - score[i+1];
	num = i + 1;
	
	cout << dmax << " *****" << endl;
      }
    }

    delete[] score;

    cout << num << endl;
    
  }
  return 0;
}

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

int main(){
	int m,max,min,gap,maxgap,ans;
  	vector<int> score(201);
  	for(int i=0; i < 10001; i++){
      cin >> m >> min >> max;
      if(m == 0 && min == 0 && max == 0){
        break;
      }else{
  	  	for(int j=0; j < m; j++){
          cin >> score.at(j);
        }
        maxgap = score.at(min-1) - score.at(min);
        ans = min;
        for(int k = min; k < max; k++){
          gap = score.at(k) - score.at(k+1);
          if(gap >= maxgap){
            maxgap = gap;
            ans = k+1;
          }
        }
        cout << ans << endl;
      }
    }
  return 0;
}

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

int main(){
  while (1){
    int m, nmin,nmax;
    cin >> m >> nmin >> nmax;
    if(m==0) break;

    vector<int> pt(m+1);
    for(int i=1; i<=m; i++){
      cin >> pt[i];
    }
    int dmax=0, mx=0;
    for(int i=nmin; i<=nmax; i++){
      if(dmax <= pt[i]-pt[i+1]){
        dmax = pt[i]-pt[i+1];
        mx=i;
      }
    }
    cout << mx << endl;
    
  }
  return 0;
}

C++: // Last Change: 11/07/2019 18:37:25.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

void solve(ll m, ll nMin, ll nMax) {
  vector<ll> P(m);
  for (auto &&e : P) {
    cin >> e;
  }

  ll gap = 0, res = nMin;
  for (int i = nMin - 1; i < nMax; ++i) {
    if (gap <= P[i] - P[i + 1]) {
      gap = P[i] - P[i + 1];
      res = i + 1;
    }
  }

  cout << res << endl;
}

int main() {
  ll m, nmin, nmax;
  while (cin >> m >> nmin >> nmax and !(m == 0 and nmin == 0 and nmax == 0)) {
    solve(m, nmin, nmax);
  }
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int m, nmin, nmax;
	while (cin >> m >> nmin >> nmax&&m&&nmin&&nmax) {
		int p[200];
		for (int i = 0; i < m; i++)cin >> p[i];
		int soeji, sa1=p[nmin-1]-p[nmin],sa2;
		for (int i = nmin - 1; i <= nmax - 1; i++) {
			if (sa1 <= p[i] - p[i + 1]) {
				sa1 = p[i] - p[i + 1];
				soeji = i+1;
			}
		}
		cout << soeji << endl;
	}
	return 0;
}

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

int main(void){
  while(true){
    int m, nmin, nmax = 0;
    cin >> m >> nmin >> nmax;
    if(m == 0 && nmin == 0 && nmax == 0){ break; }

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

    int maxgap = 0, ans = 0;
    for(int i = nmin; i <= nmax; i++){
      int gap = p[i - 1] - p[i];
      if(maxgap <= gap){
        maxgap = gap;
        ans = i;
      }
    }
    
    cout << ans << endl;
  }




  return 0;
}