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 DEBUG(x) cerr <<#x<<":"<<x<<endl;
#define DEBUG2(x, y) cerr <<#x<<":"<<x<<" "<<#y<<":"<<y<<endl;
#define DEBUG3(x, y, z) cerr <<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl;
#define DEBUGVC(x) cerr <<#x<<": "; for(auto a:x) cerr << a <<" "; cerr << endl;
#define DEBUGMP(x) cerr <<#x<<":"<<endl; for(auto a:x) cerr << a.first <<" "<< a.second << endl;
#define MAX_N (1000006)
#define INF (1LL << 60)
const int MOD = (int)1e9+7;


signed main() {
    while(1) {
        int m, n_min, n_max;
        cin >> m >> n_min >> n_max;
        if(m==0&&n_min==0&&n_max==0) return 0;
        vector<int> p(m);
        for(int i=0; i<m; i++) cin >> p[i];
        sort(p.rbegin(),p.rend());
        vector<pair<int,int>> n;
        for(int i=n_min; i<=n_max; i++) {
            n.push_back(make_pair(p[i-1]-p[i], i));
            //cout << p[i-1]-p[i] <<" "<< i << endl;
        }
        sort(n.rbegin(),n.rend());
        //for(int i=0; i<n.size(); i++) cout << n[0].first <<" "<< n[0].second << endl;
        cout << n[0].second << endl;
    }
}

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

int main(){
  int m, nmin, nmax;
  while(cin >> m >> nmin >> nmax, m || nmin || nmax){
    nmin--;
    nmax--;
    vector<int> v(m);
    
    for(int i = 0; i < m; i++){
      cin >> v[i];
    }

    pair<int, int> ans = make_pair(0, 0);

    for(int i = nmin; i <= nmax; i++){
      if(v[i] - v[i + 1] >= ans.second){
        ans = make_pair(i + 1, v[i] - v[i + 1]);
      }  
    } 
    cout << ans.first << endl;
  }
}

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T> void operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) cin >> e; }

typedef long long ll;
int const inf = 1<<29;

int main() {

  int M, N[2];
  for(; cin >> M >> N[0] >> N[1] && M;) {
    vector<int> vs(M); cin >> vs;
    int maxgap = 0;
    int maxnum = -1;
    REP(num, N[0], N[1] + 1) {
      if(maxgap <= vs[num - 1] - vs[num]) {
        maxgap = vs[num - 1] - vs[num];
        maxnum = num;
      }
    }

    cout << maxnum << endl;
  }
  
  return 0;
}

C++: #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;
int ps[210];
int main(){ _;
  int m,nmin,nmax;
  while(cin>>m>>nmin>>nmax,(m|nmin|nmax)!=0){
    nmin--;nmax--;
    int p;
    REP(i,m)cin>>ps[i];
    int maxGap=0,maxGapIndex;
    for(int i=nmin;i<=nmax;i++){
      int gap=ps[i]-ps[i+1];
      if(gap>=maxGap){
	maxGap=gap;
	maxGapIndex=i;
      }
    }
    cout<<maxGapIndex+1<<endl;
  }
}

C++: #include <cstdio>

int m,nmin,nmax;
int P[205];
int diff[205];

int main(){

    while(scanf("%d%d%d",&m,&nmin,&nmax)&&m&&nmin&&nmax){
        for(int i=1;i<=m;i++) scanf("%d",P+i);
        for(int i=1;i<=m-1;i++) diff[i]=P[i]-P[i+1];

        int ans=nmax,difference=diff[ans];
        for(int i=nmax;i>=nmin;i--)
            if (diff[i]>difference) ans=i,difference=diff[i];

        printf("%d\n",ans);
    }


    return 0;
}

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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define ll1 1ll
#define ONE 1ll
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF =
    sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>
istream &operator>>(istream &is, pair<T, S> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> &p) {
  os << p.first << " " << p.second;
  return os;
}

template <typename T> void printvv(const vector<vector<T>> &v) {
  cerr << endl;
  rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
    if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
      cerr << "INF";
    } else
      cerr << v[i][j];
    cerr << (j == v[i].size() - 1 ? '\n' : ' ');
  }
  cerr << endl;
}
/*
   typedef __int128_t Int;
   std::ostream &operator<<(std::ostream &dest, __int128_t value) {
   std::ostream::sentry s(dest);
   if (s) {
   __uint128_t tmp = value < 0 ? -value : value;
   char buffer[128];
   char *d = std::end(buffer);
   do {
   --d;
 *d = "0123456789"[tmp % 10];
 tmp /= 10;
 } while (tmp != 0);
 if (value < 0) {
 --d;
 *d = '-';
 }
 int len = std::end(buffer) - d;
 if (dest.rdbuf()->sputn(d, len) != len) {
 dest.setstate(std::ios_base::badbit);
 }
 }
 return dest;
 }

 __int128 parse(string &s) {
 __int128 ret = 0;
 for (int i = 0; i < s.length(); i++)
 if ('0' <= s[i] && s[i] <= '9')
 ret = 10 * ret + s[i] - '0';
 return ret;
 }
 */

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

void solve(int M, int n1, int n2) {
  vector<int> P(M);
  rep(i, 0, M) { cin >> P[i]; }
  sort(all(P), greater<int>());
  pii ans(0, 0);
  rep(i, n1 - 1, n2) { chmax(ans, pii(P[i] - P[i + 1], i)); }
  cout << ans.second+1 << endl;
}
signed main(signed argc, char *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);

  int M, n1, n2;
  while (cin >> M >> n1 >> n2, M or n1 or n2) {
    solve(M, n1, n2);
  }

  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;
}