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

signed main() {
  int m, l, r;
  while ( cin >> m >> l >> r, m ) {
    l--; r--;
    vector<int> P(m);
    for ( int i = 0; i < m; i++ ) cin >> P[i];
    int ans = 0;
    int gap = 0;
    for ( int i = l; i <= r; i++ ) {
      if ( P[i]-P[i+1] >= gap ) {
	ans = i;
	gap = P[i]-P[i+1];
      }
    }

    cout << ans+1 << endl;
  }

  return 0;
}

C++: #include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <functional>
#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;
const int MOD = 1000000007;


typedef long long int ll; 
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

void floatOutPutSetup(){
    cout << fixed;
    cout << setprecision(10);
}

int solve(int m,int nmin,int nmax) {
    vector<int> p(m,0);
    vector<int> s;
    rep(i,m)cin>>p[i];
    sort(p.rbegin(),p.rend());//降順ソート
    rep(i,nmax-nmin+1) s.push_back(p[nmin+i-1]-p[nmin+i]);
    
    Pii ans;
    ans = make_pair(0,0);

    rep(i,nmax-nmin+1){
        if(s[i]>=ans.second) ans = make_pair(i,s[i]);
    }
    return nmin+ans.first;
}

int main(){
    int m,nmin,nmax;
    cin >>m>>nmin>>nmax;
    while (m!=0){
        cout<<solve(m,nmin,nmax)<<endl;
        cin>>m>>nmin>>nmax;
    }
    
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  while(1) {
    int m, n1, n2; cin >> m >> n1 >> n2;
    if(m == 0) break;
    vi a(m);
    for(int i=0;i<m;++i) {
      cin >> a[i];
    }
    sort(a.rbegin(), a.rend());
    n1--;
    n2--;
    int ma = 0;
    int argma = 0;
    for(int i=n1;i<=n2;++i) {
      if(ma <= a[i] - a[i+1]) {
        ma = a[i] - a[i+1];
        argma = i+1;
      }
    }
    cout << argma << endl;
  }
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
int main(){
	while(1){
		int m,na,nb;
		cin>>m>>na>>nb;
		if(!m)break;
		int p[m];
		rep(i,m)cin>>p[i];
		int s=0;
		int ans;
		REP(i,na,nb){
			if(s<=p[i-1]-p[i]){
				s=p[i-1]-p[i];
				ans=i;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
using namespace std;

int main() {
	int m, nmin, nmax, p[201], maxg = 0 , n;
	while (1) {
		scanf("%d %d %d", &m, &nmin, &nmax);
		for (int i = 1; i <= m; i++) {
			scanf("%d", &p[i]);
		}
		for (int j = nmin; j <= nmax; j++) {
			if (p[j] - p[j+1] > maxg) {
				maxg = p[j] - p[j+1];
				n = j;
			}
		}
		if (m == 0 && nmin == 0 && nmax == 0) {
			return 0;
		}
		else {
			printf("%d\n", n);
		}
	}
}

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

int main(){
    while (1){
        int n, nmn, nmx;
        cin >> n >> nmn >> nmx;
        if (n == 0) break;
        vector<int> a(n);
        for (int i = 0; i < n; i++) cin >> a[i];
        int ans = - 1;
        int tmp = - 1;
        for (int i = nmn - 1; i < nmx; i++){
            if (a[i] - a[i + 1] >= tmp) {
                tmp = a[i] - a[i + 1];
                ans = i + 1;
            }
        }
        cout << ans << endl;
    }
}

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

int main() {
    int m, nmin, nmax;
    while(cin >> m >> nmin >> nmax, m) {
        vector<int> p(m);
        for(int i = 0; i < m; ++i) {
            cin >> p[i];
        }
        sort(rbegin(p), rend(p));
        int val = 0;
        int ans = 0;
        for(int i = nmin - 1; i < nmax; ++i) {
            if(val <= p[i] - p[i + 1]) {
                val = p[i] - p[i + 1];
                ans = i + 1;
            }
        }

        cout << ans << endl;
    }
}

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

int m,mn,Mn,gap,ans;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> m >> mn >> Mn,m){
        vector<int> P(m);
        for (int i=0;i<m;++i) cin >> P[i];
        gap=0;
        for (int i=mn-1;i<Mn;++i){
            if (gap<=P[i]-P[i+1]){
                gap=P[i]-P[i+1],ans=i+1;
            }
        }
        cout << ans << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int m,a,b,p[205],c,d;

int main(){
  while(1){
    cin>>m>>a>>b;
    if(!m&&!a&&!b)break;
    c=d=0;
    for(int i=0;i<m;i++)cin>>p[i];
    for(int i=b-1;i>=a-1;i--)
      if(p[i]-p[i+1]>c)c=p[i]-p[i+1],d=i+1;
    cout<<d<<endl;
  }
  return 0;
}

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

int main(){
  int m, n, diff, n_min, n_max, point[200];
  while(cin >> m >> n_min >> n_max, m){
    n = 0; diff = 0;
    for(int i = 0; i < m; ++i) cin >> point[i];
    for(int i = n_min; i <= n_max; i++){
      if(diff <= point[i - 1] - point[i]){
        diff = point[i - 1] - point[i];
        n = i;
      }
    }
    cout << n << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

int main (int argc, char *argv[]) {
    int m, n_min, n_max, p;
 
    while (cin>>m>>n_min>>n_max, m||n_min||n_max) {
        vector<int> v;
        for (int i = 0; i < m; ++i) {
            cicodn>>p;
            v.push_back(p);
        }
        sort(v.begin(), v.end(), greater<int>());
        int diff = 0;
        int ans = 0;
        for (int i = n_max - 1; i >= n_min - 1; --i) {
            if (v[i] - v[i+1] > diff) {
                diff = v[i] - v[i+1];
                ans = i;
            }
        }
        cout<<ans+1<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main(){
	int n,nn;
	int nmax,nmin;
	vector<int> v;
	vector<int> free;
	int point;
	int ss,s;

	while(1){
		cin >> n;
		cin >> nmin;
		cin >> nmax; 
		ss = 0;
		s = 0;
		nn = 0;
		v.swap(free);

		if(n == 0 && nmax == 0 && nmin == 0){
			break;
		}

		for(int i = 0; i < n; i++){
			cin >> point;
			v.push_back(point);
		}
		
		for(int i = nmin - 1;i < nmax; i++){
			s = v[i] - v[i+1];
			if(i == nmin -1 || ss <= s){
				ss = s;
				nn = i+1;
			}
		}

		cout << nn <<endl;
	
	}
}