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 _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,N,j) for(int i = (N-1);i >= (j);i--)
#define _rec(i,N,j) for(int i = (N);i >=(j);i--)
#define ALL(x) x.begin(),x.end()
#define MEM(a,n) memset(a,n,sizeof(a))
#define fst first
#define scd second
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

int get_int(){int x;scanf("%d",&x);return x;}
LL get_ll(){LL x;scanf("%lld",&x);return x;}
double get_db(){double x;scanf("%lf",&x);return x;}

template<typename T> int chmin(T &a,T b){if(a > b){a = b;return 1;}else return 0;}
template<typename T> int chmax(T &a,T b){if(a <= b){a = b;return 1;}else return 0;}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {_for(i,0,v.size()) os << v[i] << " ";return os;}
template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){for(auto a:v) os << a <<" ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& v){os << v.fst <<" "<<v.scd << " ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const map<T1,T2>& v){for(auto a:v) cout << a << endl;return os;}

static const int dx[8] = { 1,  0, -1,  0,  1, -1,  1, -1};
static const int dy[8] = { 0,  1,  0, -1,  1, -1, -1,  1};
const double pi  = acos(-1.0);
const double eps = 1e-8;
const LL  INF  = 0x3f3f3f3f3f3f3f3f;
const int inf  = 0x3f3f3f3f;
const int mod = 1e9+7;

int m,nmin,nmax;
const int maxn = 205;
int score[maxn];
bool get_input(){
    scanf("%d %d %d",&m,&nmin,&nmax);
    if(m == 0) return false;
    
    _for(i,0,m){
        scanf("%d",&score[i]);
    }
    return true;
}
int main(){
    
    while(get_input()){
        int cnt = m;
        int p = 0;
        int ans = 0;
        int gap = -1;
        int k = nmax - 1;
        while(score[k] == score[k+1]){
            k--;
            nmax--;
        }

        p = nmin-1;
        
        while(p <= nmax-1){
            if(chmax(gap,score[p] - score[p+1])) ans = p+1;
            p++;
        }

        while(score[ans-1] == score[ans]) ans++;

        cout << ans << endl;
    }

    return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#define _USE_MATH_DEFINES
#include<cmath>
using namespace std;
int main(){
  int m,min,max;
  while(cin >> m >> min >> max,m){
    int p[m];
    for(int i=0;i<m;i++) cin >> p[i];
    int gap=0,n=0;
    for(int i=min-1;i<max;i++){
      if(gap<=p[i]-p[i+1]){
        n=i+1;
        gap=p[i]-p[i+1];
      }
    }
  cout << n << endl;
  }
}

C++: #include <iostream>

using namespace std;

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

    int P[m];

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

    int ans = nmin;
    int max = -1;
    for(int i = nmin ; i <= nmax ; i++){
      if(max >= P[i] - P[i - 1]){
        max = P[i] - P[i - 1];
        ans = i;
      }
    }

    cout << ans << endl;
  }



  return 0;
}

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

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

        int ans=b;
        int gap=0;

        //????????????i?????¨??????
        for(int i=b; i>=a; --i)
        {
            int tgap=p[i-1]-p[i];
            if(tgap>gap)
            {
                gap=tgap;
                ans=i;
            }
        }

        cout << ans << endl;
    }
    return 0;
}

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

using namespace std;

int main() {
	vector<int> v;
	int m, nmin, nmax, gap = -1, gapnum;
	for (;;) {
		cin >> m >> nmin >> nmax;
		if (m == 0 && nmin == 0 && nmax == 0) break;
		v.resize(m);
		for (int i = 0; i < m; i++) cin >> v[i];

		for (int i = nmin; i <= nmax; i++) {
			if (gap == -1) {
				gap = v[i] - v[i + 1];
				gapnum = i;
			}
			else {
				if (gap <= v[i] - v[i + 1]) {
					gap = v[i] - v[i + 1];
					gapnum = i;
				}
			}
		}
		cout << gapnum << endl;
	}
}

C++: ///
// File:  1600.cpp
// Author: ymiyamoto
//
// Created on Fri Nov 10 22:43:01 2017
//

#include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>

using namespace std;

int32_t main()
{
  while (true) {
    uint32_t m, n_min, n_max;
    cin >> m >> n_min >> n_max;
    if (m == 0) break;

    vector<uint32_t> points;
    for (uint32_t i = 0; i < m; i++) {
      uint32_t P;
      cin >> P;
      points.push_back(P);
    }

    uint32_t max_gap = 0;
    uint32_t n = 0;
    for (uint32_t i = n_min; i <= n_max; i++) {
      uint32_t pass_point = points[i - 1];
      uint32_t fail_point = points[i];
      uint32_t gap = pass_point - fail_point;
      if (max_gap <= gap) {
        max_gap = gap;
        n = i;
      }
    }

    cout << n << endl;
  }

  return 0;
}