Go: package main

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

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

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
		}

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

		// 最低合格者数と最高合格者数の間の各得点間のギャップが最大になる合格者数を取得する
		scoreGap := 0
		scoreGapMax := 0
		qualifiedNum := 0
		for n := nMin; n <= nMax; n++ {
			scoreGap = score_list[n-1] - score_list[n]
			if scoreGap >= scoreGapMax {
				scoreGapMax = scoreGap
				qualifiedNum = n
			}
		}

		fmt.Println(qualifiedNum)
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
#define REP(i,b,e) for(int i=(b);i<(e);++i)
#define rep(i,e) for(int i=0;i<(e);++i)

int main() {
  int m, n1, n2;
  while(cin >> m >> n1 >> n2){
    if(m==0) return 0;
    vector<int> v(m);
    rep(i, m) cin >> v[i];
    sort(v.begin(), v.end(), greater<int>());
    int gap=0, ans;
    REP(i, n1-1, n2){
      int t = v[i]-v[i+1];
      if(gap<=t){
        gap = t;
        ans = i+1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <queue>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define INF 1<<30
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	int n, a, b;
	while(cin >> n >> a >> b) {
		if(n == 0 && a == 0 && b == 0) break;

		vector<int> v(n);
		rep(i, n) cin >> v[i];
		v.push_back(v[n-1]);

		int ans = 0, id = 0;
		REP(i, a, b + 1) {
			if(ans <= v[i-1] - v[i]) {
				ans = v[i-1] - v[i];
				id = i;
			}
		}

		cout << id << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int m,s,g,p[200];
  while(cin>>m>>s>>g,m){
    int ans=-1,an;
    for(int i=0;i<m;i++)cin>>p[i];
    sort(p,p+m,greater<int>());
    for(int i=g;i>=s;i--)if(ans<p[i-1]-p[i])ans=p[i-1]-p[i],an=i;
    cout<<an<<endl;
  }
  return 0;
}

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

using VI = vector<long>;

int main() {
  int m, nmin, nmax;
  while (1) {
    cin >> m >> nmin >> nmax;
    if (m) {
      VI ps;
      for (int i = 0; i < m; i++) {
        long p;
        cin >> p;
        ps.push_back(p);
      }
      long n;
      long maxgap = 0;
      for (int i = nmin; i <= nmax; i++) {
        assert(i - 1 >= 0);
        assert(i < m);
        long gap = ps[i - 1] - ps[i];
        if (gap >= maxgap) {
          maxgap = gap;
          n = i;
        }
      }
      cout << n << endl;
    } else {
      return 0;
    }
  }
}

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 a,b,c;
  while(cin>>a>>b>>c,a){
    int p[a];
    for(int i=0;i<a;++i) cin>>p[i];
    sort(p,p+a);
    int x=0, y;
    for(int i=a-b;i>=a-c;--i)
      if(p[i]-p[i-1]>=x) x=p[i]-p[i-1], y=i;
    cout<<a-y<<endl;
  }
  return 0;
}

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

vector<int> p;

int main(){
while(1){	
	
	int m, mi, ma;
	cin >> m >> mi >> ma;
	if(m == 0 and mi == 0 and ma == 0) break;
	for(int i=0; i<m; i++){
		int tmp;
		cin >> tmp;
		p.push_back(tmp);
	}
	
	sort(p.begin(), p.end());
	reverse(p.begin(), p.end());
	
	int gap = 0;
	int ans = 0;
	for(int i=mi; i <= ma; i++){
		if(gap <= p[i-1] - p[i]){
			gap = p[i-1] - p[i];
			ans = i;
		}
	}
	
	cout << ans << endl;
	p.clear();
	
	
	//debug
	//for(int i=0; i<m; i++) cout << p[i] << endl;

}//end	
	
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>

using namespace std;

#define Getsign(n) ((n > 0) - (n < 0))
#define QWERTYR(c) (c == 'y' || c == 'u' || (c >= 'h' && c <= 'p') ?	true : false)
map<string, int> roma_time = { { "I",1 },{ "II",2 },{ "III",3 },{ "IIII",4 },{ "V",5 },{ "VI",6 },{ "VII",7 },{ "VIII",8 },{ "IX",9 },{ "X",10 },{ "XI",11 },{ "XII",12 } };

typedef vector<int> Ivec;
typedef pair<int, int> pii;

int main() {
	int n, Max, Min;
	while (scanf("%d %d %d", &n, &Min, &Max)) {
		if (n == 0)
			return 0;

		vector<int> points;

		for (int i = 0; n > i; i++) {
			int p;
			scanf("%d", &p);
			points.push_back(p);
		}
		int num, Maxim = -1;
		for (int i = Min-1; Max-1 >= i; i++) {
			if (points[i] - points[i + 1] >= Maxim) {
				num = i;
				Maxim = points[i] - points[i + 1];
			}
		}
		printf("%d\n", num + 1);
	}
	return 0;
}

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

int main(){
  while(1){
  int m,l,r;
  cin>>m>>l>>r;
  if(!m&&!l&&!r)break;

  int a[300];
  for(int i=0;i<m;i++)cin>>a[i];

  sort(a,a+m);
  reverse(a,a+m);
  int gap=0,n;
  for(int i=l-1;i<r;i++)
    if(a[i]-a[i+1]>=gap)n=i,gap=a[i]-a[i+1];
  
  cout <<n+1<<endl;
  }
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}

int main(){
	int M,N_min,N_max;
	while(1){
		cin>>M>>N_min>>N_max;
		if(M==0)break;
		vector<int> p(M);
		for(int i=0;i<M;i++)cin>>p[i];
		int gap=-1,ans=0;
		for(int i=N_max;i>=N_min;i--){
			int tmp=p[i-1]-p[i];
			if(gap<tmp){
				gap=tmp;
				ans=i;
			}
		}
		cout<<ans<<endl;
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
//ranker
using namespace std;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using psi = pair<string, int>;
using D = double;


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

  int M, min, max;

  while(1){
    cin >> M >> min >> max;

    if(M == 0 && min == 0 && max == 0) break;

    int P[M];
    REP(i, M) cin >> P[i];

    int gomi = 0;
    int cnt = 0;
    REPS(i, min-1, max){
      if(gomi <= P[i]-P[i+1]){
      gomi = P[i]-P[i+1];
      cnt = i+1;
      cout << cnt << " " << gomi << endl;
    }
  }
    cout << cnt << endl;
  }

  return 0;
}