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<iostream>
using namespace std;
int main(){

  int m,a,b,ans;
  int p[201];

  cin >> m >> a >> b;
  while(m != 0 || a != 0 || b != 0){
    for(int i = 0;i < m;i++){
      cin >> p[i];
    }
    for(int i = a;i <= b;i++){
      if(i == a) ans = a;
      else if(p[i-1]-p[i] >= p[ans-1]-p[ans]) ans = i;
    }
    cout << ans << endl;
    cin >> m >> a >> b;
  }

  return (0);
}

C++: #include <iostream>
#include <cstdlib>
#include <algorithm>
#include <math.h>

using namespace std;
int p[201];
int m,mi,ma;
int gap=0,ans;
int solve(){
    for(int i=0;i<m;i++){
        
        cin>>p[i];
        
        }
     for(int i=mi-1;i<ma;i++){
            if(gap<=p[i]-p[i+1]){
            //cout<<p[i]<<"  "<<i+1<<endl;
                gap=max(gap,p[i]-p[i+1]);
                ans=i+1;
            }
            
        }
        return 0;

}
int main()
{
   
   while(1){
    cin>>m>>mi>>ma;
    gap=0;
    
    if(m==0)return 0;
    solve();
    cout<<ans<<endl;
   }return 0; 
}

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

int main()
{
  int m,a,b;
  int p[401];

  while(1){
    cin>>m>>a>>b;
    if(m+a+b==0)break;
    for(int i=0;i<m;i++)cin>>p[i];
    sort(p,p+m);
    reverse(p,p+m);

    int ans=0,tmp=0;
    for(int i=a;i<=b;i++){
      if(tmp<=p[i-1]-p[i]){
	ans=i;
	tmp=p[i-1]-p[i];
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int p[200];
int main(){
	int m,n1,n2;
	while(true){
	cin>>m>>n1>>n2;
	if(m==0&&n1==0&&n2==0)break;
	for(int i=0;i<m;i++){
		cin>>p[i];
	}
	int set,best=0;
	for(int i=n1;i<=n2;i++){
		if(best<=p[i-1]-p[i]){
			set=i;
			best=p[i-1]-p[i];
		}
	}
	cout<<set<<endl;
	}
	return 0;
}

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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

typedef pair<int, int> P;

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    int n, mi, ma;
    while( cin >> n >> mi >> ma, n | mi | ma ){
        vector<int> p( n );
        REP( i, n ) cin >> p[i];

        int ans = 0, sa = -1;
        FOR( i, mi, ma + 1 ){
            if( chmax( sa, p[i - 1] - p[i] ) || sa == p[i - 1] - p[i] ){
                ans = i;
            }
        }
        cout << ans << endl;
    }
}

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

int main()
{
	while (1)
	{
		vector<int> GAP;
		priority_queue<int> PQ;
		int m, n_min, n_max;
		cin >> m >> n_min >> n_max;
		if (m == 0)break;
		for (int i = 0; i < m; i++)
		{
			int k;
			cin >> k;
			PQ.push(k);
		}
		for (int i = n_min; i <= n_max; i++)
		{
			priority_queue<int> tPQ = PQ;
			for (int l = 0; l < i-1; l++)
			{
				tPQ.pop();
			}
			int temp = tPQ.top();
			tPQ.pop();
			GAP.push_back(temp - tPQ.top());
		}
		int max_gap = 0;
		int index = 0;
		int max_index;
		for (auto itr = GAP.begin(); itr != GAP.end(); itr++)
		{
			if (max_gap <= *itr)
			{
				max_gap = *itr;
				max_index = index;
			}
			index++;
		}
		cout <<n_min+max_index << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define ll long long
#define all(a) (a).begin(),(a).end()

int main(int argc, char const *argv[]) {
  while(1){
    ll m=0,nmin=0,nmax=0;
    scanf("%lld%lld%lld",&m,&nmin,&nmax);
    if(m==0 && nmin==0 && nmax==0){
      break;
    }
    std::vector<ll> p(m);
    for (int i = 1; i <= m; i++) {
      scanf("%lld",&p[i]);
    }
    ll 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;
    }
    printf("%lld\n",memoid);
  }
  return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
#define mod 1000000007
#define all(c) begin(c),end(c)
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
using ll = long long;
using vi = vector<int>; using vs = vector<string>;
int dd[] = { 0, 1, 0, -1, 0 }; //→↓←↑

void solve()
{
	int M, MIN, MAX;
	while (cin >> M >> MIN >> MAX, M)
	{
		vector<int> A(M);
		for (int i = 0; i < M; i++) {
			cin >> A[i];
		}
		sort(A.begin(), A.end());
		reverse(A.begin(), A.end());
		int gap = -1;
		int ans = -1;
		for (int i = MIN - 1; i < MAX; i++)
		{
			if (gap <= A[i] - A[i + 1])
			{
				gap = A[i] - A[i + 1];
				ans = i + 1;
			}
		}
		cout << ans << endl;
	}
}

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

C++: #include<iostream>
using namespace std;
int main(){
	int a,min,max,p,mmax=0,mm;
	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){
				if(p-mm>mmax) mmax=p-mm;
			}
			mm=p;
		}
		cout<<mmax<<endl;
	}
	return 0;
}

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

int main(void){
    while(true){
        int n=0, nmin=0, nmax=0, m=0, prev=0, dif=0, max=-100;
        cin >> m >> nmin >> nmax;
        if(m==0 && nmin==0 && nmax==0) break;
        cin >> prev;
        for(int i=1;i<m;++i){
            int score;
            cin >> score;
            dif = prev - score;
            prev = score;
            if(i < nmin || i > nmax) continue;
            if(max <= dif){
                n = i;
                max = dif;
            }
        }
        cout << n << endl;
    }
}

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

using namespace std;

namespace {

    typedef double real;
    typedef long long ll;

    template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) {
        if (vs.empty()) return os << "[]";
        os << "[" << vs[0];
        for (int i = 1; i < vs.size(); i++) os << " " << vs[i];
        return os << "]";
    }
    template<class T> istream& operator>>(istream& is, vector<T>& vs) {
        for (auto it = vs.begin(); it != vs.end(); it++) is >> *it;
        return is;
    }

    int M, n, N;
    vector<int> P;
    bool input() {
        cin >> M >> n >> N;
        if (M == 0 && n == 0 && N == 0) return false;
        P.clear(); P.resize(M); cin >> P;
        return true;
    }

    void solve() {
        int ans = -1;
        int g = 0;
        for (int i = n; i <= N; i++) {
            int c = P[i - 1] - P[i];
            if (c >= g) {
                ans = i;
                g = c;
            }
        }
        cout << ans << endl;
    }
}

int main() {
    while (input()) solve();
    return 0;
}