Go: // Entrance Examination(入学試験)
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1600&lang=jp
package main

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

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
		}

		points := []int{}
		for i := 0; i < m; i++ {
			points = append(points, nextInt(sc))
		}

		gapMax, pass := 0, 0
		for n := nMin; n <= nMax; n++ {
			gap := points[n-1] - points[n]
			if gap >= gapMax {
				gapMax, pass = gap, n
			}
		}

		fmt.Println(pass)
	}
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

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

using namespace std;

int main() {
  int m, nmin, nmax;
  while (cin >> m, cin >> nmin, cin >> nmax, m && nmin && nmax) {
    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 ans = 0;
    int diffmax = 0;
    for (int i = nmin - 1; i <= nmax - 1; i++) {
      //cerr << p[i] - p[i + 1] << " ";
      if (diffmax <= p[i] - p[i + 1]) {
        diffmax = p[i] - p[i + 1];
        ans = i+1;
      }
    }
   // cerr << endl;
    cout << ans << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<bitset>
#define ld long double
#define ll long long int
#define ull unsigned long long int
#define rep(i,n) for(i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define INF INT_MAX
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define vvc vector<vector<char> >
#define vvs vector<vector<string> >
#define P 1000000007
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const long long LLINF=1LL<<60;
//set<int>::iterator it;
//|\_
//g++ -std=c++1z temp.cpp
//./a.out





int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    int i,nmin,nmax,m,j;
    while(1){
        cin>>m>>nmin>>nmax;
        if(nmin==0&&m==0)break;
        
        int diff=0;
        int diffc=0;
        vector<int> v(m,0);
        rep(i,m)cin>>v[i];
        for(i=nmin-1;i<nmax;i++){
            // cout<<i<<" "<<v[i+1]-v[i]<<" "<<diff<<endl;
            if(v[i]-v[i+1]>=diff){
                diff=v[i]-v[i+1];
                diffc=i+1;
            }
        }
        fin(diffc);
    }
//////////////////////////////////////////////////////
return 0;}

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

using namespace std;


const int MAX=200;

int main(){
    int m,nmin,nmax,P[MAX];
    int pass;
    while(cin>>m>>nmin>>nmax && m){
        pass=nmin;
        for(int i = 0;i<m;i++){
            cin >>P[i];
        }
        int gap[MAX-1],maxgap=0;
        for(int i=nmin-1;i<nmax;i++){
            gap[i]=P[i]-P[i+1];
            if(gap[i]>=maxgap){pass=i+1;}
            maxgap=max(maxgap,gap[i]);
        }
        cout << pass << endl;
    }
    return 0;
}

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[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 <iostream>
#include <cstdlib>
using namespace std;
int main(){
  int m, nmin, nmax;
  int p[201];
  int gap;
  int ans;
  while(cin>>m>>nmin>>nmax&&m&&nmin&&nmax){
    ans = -1;
    gap = -1;

    memset(p, 0, sizeof p);

    for(int i=1; i<=m; i++){
      cin >> p[i];
    }
    for(int i=nmin; i<=nmax; i++){
      if(gap<=p[i]-p[i+1]){
        gap = p[i]-p[i+1];
        ans = i;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

using namespace std;

int main(){
    int m,nmin,nmax;
    while(true){
        cin>>m>>nmin>>nmax;
        if(m==0)break;
        int cnt=0;
        int t=0;
        int gap=0;
        vector<int> p(m);
        for (int i = 0; i < m; ++i) {
            cin>>p[i];
        }
        for (int i = 0; i < m-1; ++i) {
            ++t;
            if(p[i]==p[i+1]){
                while(p[i]==p[i+1]){
                    ++i;
                    ++t;
                }
            }
            if(cnt+t<=nmax){
                if(cnt+t<=nmin||gap<=p[i]-p[i+1]){
                    cnt+=t;
                    t=0;
                    if(cnt>=nmin)gap=p[i]-p[i+1];
                }
            }
            else break;
        }
        cout<<cnt<<endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using P = pair<ll, ll>;
const long double PI = acos(-1.0L);
ll GCD(ll a, ll b) { return b?GCD(b, a%b):a; }
ll LCM(ll a, ll b) { return a/GCD(a, b)*b; }

int m, nmin, nmax;

int main() {
    while(1) {
        cin >> m >> nmin >> nmax;
        if(m == 0 && nmin == 0 && nmax == 0) break;
        vector<int> pvec(m, 0);
        for(int i = 0; i < m; ++i) {
            cin >> pvec[i];
        }
        int ans = 0;
        int num = 0;
        for(int i = nmin; i <= nmax; ++i) {
            int pass = pvec[i-1];
            int npass = pvec[i];
            int g = pass-npass;
            if(ans <= g) {
                num = i;
                ans = g;
            }
        }
        cout << num << endl;
    }
}

C++: #include <stdio.h>

int main(){
	int m,na,nb,p[200];
	while(1){
		scanf("%d %d %d",&m,&na,&nb);
		if(!m) break;
		for(int i=0;i<m;i++)
			scanf("%d",&p[i]);
		int max=0;
		int ans;
		for(int i=na;i<=nb;i++){
			if(max<p[i]-p[i-1]){
				max=p[i]-p[i-1];
				ans=i;
			}
		}
		printf("%d\n",i);
	}
	return 0;
}

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

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

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

int main() {
	int m,nmin,nmax,p[10000],ans,gyp,gyp2;
	
	for(;;){
		cin>>m>>nmin>>nmax;
		if(m==0&&nmin==0&&nmax==0)break;
		
		for(int i=0;i<m;i++){
			cin>>p[i];
			
			if(i==1){
				gyp=p[0]-p[1];
				ans=2;
			}
			
			if(i>1&&i<=nmax){
				gyp2=p[i-1]-p[i];
				if(gyp2>=gyp&&nmin<=i){
					gyp=gyp2;
					ans=i;
				}
			}
			}
			cout<<ans<<endl;
			gyp=0;
			ans=0;
		}
	
	return 0;
}

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

using namespace std;

#define rep(i, n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define pb push_back

int main(){
	int x,y,z;
	while(1){
				cin>>x>>y>>z;

		if(x==0&&y==0&&z==0)break;


		int a[114514];

		rep(i,x){
			cin>>a[i];
		}

		int count=0;
		int tmp=0;
		int ans=0;
		repi(i,y-1,z){
			// cout<<a[i]<<endl;
			// cout<<a[i+1]<<endl;
			
			if(tmp<=a[i]-a[i+1]){
				tmp=max(tmp,a[i]-a[i+1]);
				ans=i-1+y;
			}

			// cout<<"tmp:"<<tmp<<endl;
			// cout<<"ans:"<<ans<<endl;

			count++;
		}
		// cout<<count<<endl;
		// cout<<"tmp:"<<tmp<<endl;
		// cout<<"ans:"<<ans<<endl;
		if(y==1){
			cout<<ans+1<<endl;
		}else{
			cout<<ans<<endl;
		}

	}
	
}