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 <bits/stdc++.h>
using namespace std;
#define int long long 
#define Rep(i, N) for(int i = 0; i < N; i++)
#define Reps(i, x, N) for(int i = x; i < N; i++)

signed main()
{
  int M, nmin, nmax;
  int P, save;
  
  while(cin >> M >> nmin >> nmax, M || nmin || nmax) {
    int maxp = -1, maxv = 0;
    
    cin >> save;
    Reps(i, 1, M) {
      cin >> P;
      if(i >= nmin && i <= nmax) {
	if(maxv < save - P) { 
	  maxp = i, maxv = save - P;
	}
      }
      save = P;
    }
    
    cout << maxp << endl;
    
  }

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define inf 1e9
#define ll long long
#define ull unsigned long long
#define M 1000000007
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define RFOR(i,m,n) for(int i=m;i>=n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) FOR(i,n,0)
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265


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

void search(int m,int nmin,int nmax){
  int p[100000];

  rep(i,m){
    cin>>p[i];
  }

  int n=nmin,pm=p[nmin-1]-p[nmin];

  FOR(i,nmin,nmax+1){
    if(pm<=p[i-1]-p[i]){
      pm = p[i-1]-p[i];
      n = i;
    }
  }

  cout<<n<<endl;

}


int main(){

  int m,nmin,nmax;
  while(1){
    cin>>m>>nmin>>nmax;
    if(m==0) break;
    search(m,nmin,nmax);
  }


  return 0;
}

C++: //#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>
#include <climits>

using namespace std;
using ll=long long;

void solve(){
  while(1){
    int m,mi,ma;
    cin >> m >> mi >> ma;
    if(!(m|mi|ma))return;
    int ar[m];
    for(int i=0;i<m;i++)
      cin >> ar[i];
    int res=0,j=-1;
    for(int i=mi;i<=ma;i++)
      if(res<=ar[i-1]-ar[i])
      {res=ar[i-1]-ar[i];j=i;}
    cout << j << endl;
  }
}

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 10e9+9
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

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

int main(){
	while (cin >> m >> nmin >> nmax&&m + nmin&&nmax){
		int gap = -1, ans;
		REP(i, m)cin >> p[i];
		sort(p, p + m, greater<int>());
		for (int i = nmin; i <= nmax; i++){
			if (gap <= p[i - 1] - p[i]){
				gap = p[i - 1] - p[i];
				ans = i;
			}
		}
		cout << ans << endl;
	}
}

C++: #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n, mi, ma;
    while (cin >> n >> mi >> ma && n){
        int ans = 0, x = 0;
        VI p(n);
        REP(i,n) cin >> p[i];
        FOR(i,mi-1,ma-1){
            int y = p[i] - p[i+1];
            if (y >= x){
                ans = i+1;
                x = y;
            }
        }
        cout << ans << endl;
    }

    return 0;
}

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

int main(){
	int m, nmax, nmin, n, a;
	while(1){
		n = 0;
		cin >> m >> nmin >> nmax;
		if(m == 0 && nmax == 0 && nmin == 0) break;
		int* p = new int[m];
		for(int i = 0; i < m; i++){
			cin >> p[i];
		}
		for(int j = nmin; j < nmax; j++){
			if(n <= p[j-1] - p[j]){
				n = p[j-1] - p[j];
				a = j;
			}
		}
		cout << a << endl;
		delete[] p;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <ctype.h>
using namespace std;
int m,mmin,mmax,check;
int psa,sa;
vector<int> mem;

int main()  {
    while(1) {
        sa = 0;
        cin >> m >> mmin >> mmax;
        if(m==0) break;
        vector<int> mem(m,0);
        for(int i = 0;i < m;i++) {
            cin >> mem[i];
        }
        for(int i = mmin-1;i < mmax;i++) {
            //cout << i << endl;
            psa = mem[i] - mem[i+1];
            //cout << psa ;
            if(psa >= sa) {
                check = i;
                sa = psa;
            }
        }
        cout << check+1 << endl;
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

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

        if (m == 0) break;

        int ans = 0;
        int tmp;
        cin >> tmp;
        int maxgap = 0;
        for (int i = 1; i < m; ++i) {
            int s;
            cin >> s;
            if (maxgap <= tmp - s && i >= nmin && i <= nmax) {
                maxgap = tmp - s;
                ans = i;
            }
            tmp = s;
        }

        cout << ans << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
#define inf 1e9
#define ll long long
#define ull unsigned long long
#define M 1000000007
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define RFOR(i,m,n) for(int i=m;i>=n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) FOR(i,n,0)
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265


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

int main(){
  cin>>m>>nmin>>nmax;

  rep(i,m){
    cin>>p[i];
  }

  int n=nmin,pm=p[nmin-1]-p[nmin];

  FOR(i,nmin,nmax+1){
    if(pm<=p[i-1]-p[i]){
      pm = p[i-1]-p[i];
      n = i;
    }
  }

  cout<<n<<endl;

  return 0;
}