Go: /*
	http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1600&lang=jp
	Entrance Examination
*/

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// 標準入力を取得するScannerのインスタンスを作成
var scanner = bufio.NewScanner(os.Stdin)

// 標準入力で各行を読み込みintとして返す

func readLine() int {
	if scanner.Scan() {
		number, _ := strconv.Atoi(scanner.Text())
		return number
	}
	return 0
}

func main() {
	// 改行から空白区切りに変更
	scanner.Split(bufio.ScanWords)

	// 0 0 0の行に到達するまでループする
	for {
		// 合格者、不合格者の境目=ギャップ
		m := readLine()   // 受験者の人数
		min := readLine() // 合格者の最小人数
		max := readLine() // 合格者の最大人数

		// 0 0 0の行に到達したのでループを抜け終了する
		if m == 0 && min == 0 && max == 0 {
			break
		}

		// 得点を格納するsliceを初期化
		ps := make([]int, 0, m)

		// sliceに得点を格納する
		for i := 0; i < m; i++ {
			ps = append(ps, readLine())
		}

		tmp := 0    // ギャップを一時的に保存
		gap := 0    // ギャップの最大値を保存
		answer := 0 // ギャップが最大になった時のindex(合格人数)を保存

		// 合格者の最小人数〜最大人数のギャップを計算する
		for i := min; i <= max; i++ {
			tmp = ps[i-1] - ps[i]

			// ギャップの最大値が更新された場合、最大値と合格人数を更新する
			// ギャップが同じ値だった場合も合格人数を更新する
			// (合格人数が多い方が優先されるので後から現れた値が優先される)
			if tmp >= gap {
				gap = tmp
				answer = i
			}
		}
		fmt.Println(answer)
	}
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1600&lang=jp>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */
int m,nmin,nmax;
ll solve(){
    ll res = 0;
    vector<ll> score(m); for(auto& in:score) cin >> in;
    ll min = -1;
    for(int i = nmin-1; i < nmax;i++){
        if(score[i]-score[i+1] >= min){
            min = score[i] - score[i+1];
            res = i+1;
        }
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    while(cin >> m >> nmin >> nmax,m){
        cout << solve() << endl;
    }
    return 0;
}

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

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

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

  int gap = -1;
  int n = -1;
 
  for(int i=n_min; i<n_max; i++){
   int g = P[i-1]-P[i];
   if(gap<=g){
    gap = g;
    n = i;
   }
  }
  
  cout << n << endl;
 }

 return 0;
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int student = 0;
    int maxN,minN = 0;
    int gap = 0,gapMax = 0,gapnumber  = 0;
    int score[1020] = {0};
    
    while(cin >> student >>minN >>maxN,student+maxN+minN)
    {
        REP(i,student)
        cin >> score[i];
  
    
    FOR(j,minN-1,maxN+1)
        {
            gap = score[0] - score[j];
            if(gapMax <= gap)
            {
                gapnumber = j;
                gapMax = gap;
                
            }
        }
        cout << gapnumber << endl;
    
    }
    return 0;
}

C++: // 2018/01/05 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int m, nmin, nmax;
		cin >> m >> nmin >> nmax;

		if(m==0 && nmin==0 && nmax==0)
			break;

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

		int gap = -1;			// ギャップの最大値
		int n = -1;			// 合格者の人数

		for(int i=nmin; i<=nmax; i++){
			int g = P[i-1]-P[i];		// ギャップ

			if(gap<=g){
				gap = g;
				n = i;
			}
		}

		cout << n << endl;
	}

	return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <sstream>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <complex>
#include <vector>
#include <cstdio>
#include <cmath>
#include <time.h>
#define all(c) ((c).begin(),(c).end())
#define rall(c) (c).rbegin(),(c).rend()
#define sort(v,n) sort(v,v+n)
#define vsort(v) sort(v.begin(),v.end())
#define vvsort(v) sort(v.begin(),v.end(),greater<int>())
#define ll long long
#define pb(a) push_back(a)
#define fi first
#define se second
#define inf 999999999
using namespace std;
const ll MOD = 1e9 + 7;
const double PI = acos(-1.0);
//---------------------------------------------------------------------------------------------//
int m, nmax, nmin;
int a[101];
int main() {
	while (cin >> m >> nmin >> nmax, m) {
		int sa = 0;
		int ansi=nmin;
		for (int i = 0; i < m; i++)cin >> a[i];
		for (int i = nmin ; i <= nmax; i++) {
			int now = sa;
			sa = max(sa, a[i-1] - a[i]);
			if (sa != now)ansi = i;
			if (a[i - 1] - a[i] == now)ansi = i;
		}
		cout << ansi << endl;
	}
}

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

using namespace std;

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

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

using namespace std;

int n[1000]={};
long long a[1000][1000]={};
long long ans = 10000000000;

int main(){
    int s=0;
    while(1){
        scanf("%d",&n[s]);
        if(n[s] == 0){
            break;
        }
        for(int i=0;i<n[s];i++){
           scanf("%lld",&a[s][i]); 
        }
        s++;
    }

    int times =s;
    int sub;
    for(int i=0;i<s;i++){
        sort(a[i],a[i]+n[i]);
        for(int j=0;j<n[i]-1;j++){
            sub = abs(a[i][j] - a[i][j+1]);
            if(ans >= sub){
                ans = sub;
            }
        }
        cout << ans << endl;
        ans = 1000000000;
    }
    

    return 0;
}

C++: #include <iostream> 
#include <vector>
#include <algorithm>
using namespace std; 
int main() {
	int m;
	int nmin;
	int nmax;
	while (cin >> m >> nmin >> nmax, m != 0) {
		vector <int> vec(m);
		for (int i = 0; i < m; i++) {
			cin >> vec.at(i);
		}
		int cnt = 0;
		for (int j = nmin-1; j <= nmax-1; j++) {
			cnt = max(cnt, vec.at(j) - vec.at(j+1));
		}
		for (int k = nmax-1; k >= nmin-1; k--) {
			if (cnt == vec.at(k) - vec.at(k+1)) {
				cout << k + 1 << endl;
				break;
			}
			else {
				continue;
			}
		}
	}
}

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

#define REP(i,n) for(int i=0;i<n;i++)

void solve(){
    int m,mn,mx;
    cin>>m>>mn>>mx;
    if(m==0){
        exit(0);
    }
    vector<int>P(m);
    REP(i,m){
        cin>>P[i];
    }
    int mx_d=0;
    int ans=0;
    for(int i=mn;i<=mx;i++){
        int dif=P[i-1]-P[i];
        if(dif>=mx_d){
            mx_d=dif;
            ans=i;
        }
    }
    cout<<ans<<endl;
}
int main(){
    while(true)solve();
}