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>
#define For(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); (i)--)
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
using namespace std;
typedef long long lint;
typedef vector<vector<lint>> mat;

int m, nmin, nmax, p[100010];

int main(){
    while(true){
        cin >> m >> nmin >> nmax;
        if(m == 0) return 0;
        rep(i, m) cin >> p[i];
        int dmax = 0;
        int num = 0;
        For(i, nmin-1, nmax){
            if(p[i] - p[i+1] >= dmax){
                dmax = p[i] - p[i+1];
                num = i + 1;
            }
        }
        cout << num << endl;
    } 
}

C++: #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Ti4 tuple<int, int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.141592653589793

int main() {
    int m, n1, n2; 
    
    while (cin >> m >> n1 >> n2) {
        if (m == 0) return 0;
        int p[m], mx = 0, mx_idx = -1;
        for (int i = 0; i < m; i++) cin >> p[i];
        for (int i = n1; i <= n2; i++) {
            if (mx <= p[i - 1] - p[i]) {
                mx = p[i - 1] - p[i];
                mx_idx = i;
            }
        }
        cout << mx_idx << endl;
    }
}

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

int main(){
    while(true){
        int m, n_min, n_max;
        cin >> m >> n_min >> n_max;
        if(m == 0) break;
        vector<int> p(m, 0);

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

        int gap = INT_MIN;
        int ans = -1;
        for(int i = n_min-1; i < n_max; ++i){
            int gap_ = p[i] - p[i+1];
            if(gap <= gap_){
                gap = gap_;
                ans = i+1;
            }
        }

        cout << ans << endl;
    }

    return EXIT_SUCCESS;
}

C++: #include <iostream>
#include <cmath>
#include <utility>
#include <functional>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <stdlib.h>
#include <deque>
using namespace std;
#define rep(i,n,x) for(int i=n;i<x;i++)
#define rem(i,n,x) for(int i=n;i>x;i--)
#define SORT(x) sort(x.begin(),x.end())
#define REV(x) reverse(x.begin(),x.end())
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define setp(x) setprecision(x)
using LL = long long;
using ULL = unsigned long long;

int main() {
	int m, nMin, nMax;
	cin >> m >> nMin >> nMax;

	while (m != 0) {
		vector<int> point(m);
		rep(i, 0, m) cin >> point[i];

		vector<int> gap(m - 1);
		// ギャップの配列
		rep(i, 0, m - 1) {
			gap[i] = point[i] - point[i + 1];
		}
		// 最大のギャップで最大の合格者数
		int mx = 0, ans = nMin;
		rep(i, nMin - 1, nMax) {
			if (mx <= gap[i]) ans = max(ans, i + 1);
			mx = max(mx, gap[i]);
		}

		cout << ans << endl;

		cin >> m >> nMin >> nMax;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void) {
	int m, n_min, n_max;
	int score[205], gap, ans, tmp;

	while (1) {
		cin >> m >> n_min >> n_max;
		if (m == 0 && n_min == 0 && n_max == 0) break;

		gap = 0; ans = 0;
		for (int i = 1; i <= m; i++) {
			cin >> score[i];
		}
		for (int j = n_min; j <= n_max; j++) {
			if (tmp = score[j] - score[j + 1] >= gap) {
				gap = tmp;
				ans = j;
			}
		}
		cout << ans << endl;
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,min,max,p,mmax=0,mm,i,b;
	while(1){
		mmax=0;
		cin>>a>>min>>max;
		if(a==min && min==max && a==0) break;
		for(i=0;i<a;i++){
			cin>>p;
			if(i>=min && i<max+1){
				if(mm-p>=mmax) {
					mmax=mm-p;
					b=i;
				//	cout<<mm<<" "<<p<<" "<<mmax<<endl;
				}
			}
			mm=p;
		}
		cout<<b<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int m,n1,n2;
  cin >> m >> n1 >> n2;
  while(m||n1||n2){
    int g=n1-1;
    int i,j,k;
    int d[300]={};
    for(i=0;i<m;i++) cin >> d[i];
    for(i=n1-1;i<n2;i++) {
      if(d[i]-d[i+1]>=d[g]-d[g+1]) g=i;
      //cout << g+1 << endl;
    }
    cout << g+1 << endl;
    //cout << endl;
    cin >> m >> n1 >> n2;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int P[10005];

int main(){
  int m, nmin, nmax;
  while(1){
    cin >> m >> nmin >> nmax;
    if(m == 0 && nmin == 0 && nmax == 0){
      break;
    }
    for(int i=0;i<m;i++){
      cin >> P[i];
    }

    int res = nmin;
    for (int i=nmin;i<=nmax;i++){
      if(P[res-1]-P[res] <= P[i-1]-P[i]){
	res = i;
      }
    }
    cout << res << endl;
  }
  return 0;
}

C++: #include<cstdio>

int main() {
	while (1) {
		int m, nmin, nmax, p[201], maxg = 0, n;
		scanf("%d %d %d", &m, &nmin, &nmax);
		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;
int m;
vector<int>p;
vector<int>s;
int maxn,minn;


int main(){
  int i,j,now=0,ni=0;
  while(1){
  cin >> m >> minn >> maxn;
  now = 0;
  if(m==0&&maxn==0&&minn==0)break;
  for(i=0;i<m;i++){
    cin >> j;
    p.push_back(j);
  }
  sort(p.begin(),p.end());
  for(i=0;i<m-1;i++)  s.push_back(p[i+1]-p[i]);
  for(i=m-minn-1;i>=m-maxn-1;i--){
    // cout << " bbb"<<s[i];
    if(s[i]>=now){
      now = s[i];
      ni = i;
      //cout <<"aaa"<< now << " "<< ni << endl;
    }
  }
  //cout <<endl<< ni << endl;
  cout << m-1-ni << endl;
  while(p.size())p.pop_back();
  while(s.size())s.pop_back();
  }
  return 0;
}

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

int main() {
  int m, n_mi, n_ma;
  while (cin >> m >> n_mi >> n_ma, m || n_mi || n_ma) {
    vector<int> p(m);
    for (int i = 0; i < m; ++i) {
      cin >> p[i];
    }
    int ma = -1;
    int res;
    for (int i = n_mi; i <= n_ma; ++i) {
      if (ma <= abs(p[i - 1] - p[i])) {
        ma = p[i - 1] - p[i];
        res = i;
      }
    }
    cout << res << endl;
  }
}