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;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	for (int a, b, c; cin >> a >> b >> c&&a;) {
		vector<int> P(a); rep(i, 0, a) { cin >> P[i]; }
		int g = INF;
		int ans = 0;
		rep(i, 1, a) {
			if (i >= b&&i <= c) {
				if (g >= P[i] - P[i - 1]) {
					g = P[i] - P[i - 1];
					ans = i;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(void) {
	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 res = 0;
		int gap = 0;
		for (int i = nmin; i <= nmax; ++i) {
			if (p[i-1] - p[i] >= gap) {
				res = i;
				gap = p[i-1] - p[i];
			}
		}
		cout << res << endl;
	}
	return 0;
}

C++: #include<cstdio>

int main() {
	int m, nmin, nmax, p[201], maxg = 0 , n;
	while (scanf("%d %d %d", &m, &nmin, &nmax)==3) {
		for (int i = 1; i <= m; i++) {
			scanf("%d", &p[i]);
		}
		for (int j = nmin; j <= nmax; j++) {
			if (p[j] - p[j+1] > maxg) {
				maxg = p[j] - p[j+1];
				n = j;
			}
		}
		if (m == 0 && nmin == 0 && nmax == 0) {
			return 0;
		}
		else {
			printf("%d\n", n);
		}
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(true) {
        int n, nmin, nmax;
        cin >> n >> nmin >> nmax;
        if(n == 0) break;
        int a[205];
        for(int i = 1; i <= n; i++) cin >> a[i];
        int gap = 0;
        int ans = 0;
        for(int i = nmin; i <= nmax; i++) {
            if(a[i] == a[i+1]) continue;
            if(gap <= a[i] - a[i+1]) {
                gap = a[i] - a[i+1];
                ans = i;
            }
            //cerr << i << " " << gap << endl;
        }
        cout << ans << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main() {
  int m, nmin, nmax;
  while (cin >> m >> nmin >> nmax) {
    if (m == 0)
      return 0;
    int mx = 0, ans = 0, a[m + 5];
    for (int i = 1; i <= m; i++)
      cin >> a[i];
    for (int i = nmin; i <= nmax; i++) {
      if (a[i] - a[i + 1] >= mx)
        mx = abs(a[i] - a[i + 1]), ans = i;
    }
    // cout << mx << endl;
    cout << ans << endl;
  }
}

C++: test

C++: #include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	int m,n_min,n_max;
	while(cin>>m>>n_min>>n_max,m){
		vector<int> sc(m);
		vector<pair<int,int> > dif_sc(m);
		
		REP(i,m){
			cin >> sc[i];
			if(i)dif_sc[i] = make_pair(sc[i] - sc[i-1],i);
		}
		int max_dif = 0,max_i;
		REP(i,m){
			if(dif_sc[i].second >= n_min && dif_sc[i].second <= n_max)
				if(max_dif >= dif_sc[i].first){
					max_dif = dif_sc[i].first;
					max_i = i;
				}
		}
		cout << max_i << endl;
	}
  return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int p[200];
int main() {
	int m, s, g;
	while (scanf("%d%d%d", &m, &s, &g), m) {
		rep(i, m)scanf("%d", &p[i]);
		sort(p, p + m, greater<>());
		int Max = 0, cnt;
		for (int i = s - 1; i < g; i++) {
			if (p[i] - p[i + 1] >= Max) {
				Max = p[i] - p[i + 1];
				cnt = i + 1;
			}
		}
		printf("%d\n", cnt);
	}
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<map>
#include<numeric>
#include<queue>
#include<string>
#include<sstream>

using namespace std;

int main(void) {

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

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

    sort(p.begin(), p.end());
    reverse(p.begin(), p.end());

    int g = 0;
    int ans = nmin;
    for(int i=nmin-1; i<nmax; i++){
      if(g <= p[i] - p[i+1]){
        ans = i+1;
        g = p[i] - p[i+1];
      }

    }
    cout << ans << endl;
  }


  return 0;
}










//

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


int main() {
    int n, mi, ma;
    while(cin >> n >> mi >> ma, n) {
        vector<int> v(n);
        int gap=0, ans=0;
        for(int i=0; i<n; ++i) {
            cin >> v[i];
        }
        
        for(int i=mi-1; i<ma; ++i) {
            if(gap == v[i] - v[i+1]) {
                ans = max(ans, i+1);
            } else if(gap < v[i] - v[i+1]) {
                gap = v[i] - v[i+1];
                ans = i+1;
            }
        }
        cout << ans << endl;
    }
}

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

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

        int* p = new int[m];// 0-origin
        for(int i = 0; i < m; i++){
            cin >> p[i];
        }

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

        cout << ans << endl;
        delete[] p;
    }





    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main(){
	int n,nn;
	int nmax,nmin;
	vector<int> v(10000,0);
	vector<int> free;
	int point;
	int ss,s;

	while(1){
		cin >> n;
		cin >> nmin;
		cin >> nmax; 
		ss = 0;
		s = 0;
		nn = 0;

		if(n == 0 && nmax == 0 && nmin == 0){
			break;
		}

		for(int i = 0; i < n; i++){
			cin >> v[i];
		}
		
		for(int i = nmin - 1;i < nmax; i++){
			s = v[i] - v[i+1];
			if(i == nmin -1 || ss <= s){
				ss = s;
				nn = i+1;
			}
		}

		cout << nn <<endl;
	
	}
}