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 <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Ti4 tuple<int, int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.141592653589793

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

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

int main(){
    while(true){
        int m, n_min, n_max;
        cin >> m >> n_min >> n_max;
        if(m == 0) break;
        vector<int> p(m, 0);

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

        int gap = INT_MIN;
        int ans = -1;
        for(int i = n_min-1; i < n_max; ++i){
            int gap_ = p[i] - p[i+1];
            if(gap <= gap_){
                gap = gap_;
                ans = i+1;
            }
        }

        cout << ans << endl;
    }

    return EXIT_SUCCESS;
}

C++: #include <iostream>
#include <cmath>
#include <utility>
#include <functional>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <stdlib.h>
#include <deque>
using namespace std;
#define rep(i,n,x) for(int i=n;i<x;i++)
#define rem(i,n,x) for(int i=n;i>x;i--)
#define SORT(x) sort(x.begin(),x.end())
#define REV(x) reverse(x.begin(),x.end())
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define setp(x) setprecision(x)
using LL = long long;
using ULL = unsigned long long;

int main() {
	int m, nMin, nMax;
	cin >> m >> nMin >> nMax;

	while (m != 0) {
		vector<int> point(m);
		rep(i, 0, m) cin >> point[i];

		vector<int> gap(m - 1);
		// ギャップの配列
		rep(i, 0, m - 1) {
			gap[i] = point[i] - point[i + 1];
		}
		// 最大のギャップで最大の合格者数
		int mx = 0, ans = nMin;
		rep(i, nMin - 1, nMax) {
			if (mx <= gap[i]) ans = max(ans, i + 1);
			mx = max(mx, gap[i]);
		}

		cout << ans << endl;

		cin >> m >> nMin >> nMax;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void) {
	int m, n_min, n_max;
	int score[205], gap, ans, tmp;

	while (1) {
		cin >> m >> n_min >> n_max;
		if (m == 0 && n_min == 0 && n_max == 0) break;

		gap = 0; ans = 0;
		for (int i = 1; i <= m; i++) {
			cin >> score[i];
		}
		for (int j = n_min; j <= n_max; j++) {
			if (tmp = score[j] - score[j + 1] >= gap) {
				gap = tmp;
				ans = j;
			}
		}
		cout << ans << endl;
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,min,max,p,mmax=0,mm,i,b;
	while(1){
		mmax=0;
		cin>>a>>min>>max;
		if(a==min && min==max && a==0) break;
		for(i=0;i<a;i++){
			cin>>p;
			if(i>=min && i<max+1){
				if(mm-p>=mmax) {
					mmax=mm-p;
					b=i;
				//	cout<<mm<<" "<<p<<" "<<mmax<<endl;
				}
			}
			mm=p;
		}
		cout<<b<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int m,n1,n2;
  cin >> m >> n1 >> n2;
  while(m||n1||n2){
    int g=n1-1;
    int i,j,k;
    int d[300]={};
    for(i=0;i<m;i++) cin >> d[i];
    for(i=n1-1;i<n2;i++) {
      if(d[i]-d[i+1]>=d[g]-d[g+1]) g=i;
      //cout << g+1 << endl;
    }
    cout << g+1 << endl;
    //cout << endl;
    cin >> m >> n1 >> n2;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int P[10005];

int main(){
  int m, nmin, nmax;
  while(1){
    cin >> m >> nmin >> nmax;
    if(m == 0 && nmin == 0 && nmax == 0){
      break;
    }
    for(int i=0;i<m;i++){
      cin >> P[i];
    }

    int res = nmin;
    for (int i=nmin;i<=nmax;i++){
      if(P[res-1]-P[res] <= P[i-1]-P[i]){
	res = i;
      }
    }
    cout << res << endl;
  }
  return 0;
}

C++: #include<cstdio>

int main() {
	while (1) {
		int m, nmin, nmax, p[201], maxg = 0, n;
		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 m;
vector<int>p;
vector<int>s;
int maxn,minn;


int main(){
  int i,j,now=0,ni=0;
  while(1){
  cin >> m >> minn >> maxn;
  now = 0;
  if(m==0&&maxn==0&&minn==0)break;
  for(i=0;i<m;i++){
    cin >> j;
    p.push_back(j);
  }
  sort(p.begin(),p.end());
  for(i=0;i<m-1;i++)  s.push_back(p[i+1]-p[i]);
  for(i=m-minn-1;i>=m-maxn-1;i--){
    // cout << " bbb"<<s[i];
    if(s[i]>=now){
      now = s[i];
      ni = i;
      //cout <<"aaa"<< now << " "<< ni << endl;
    }
  }
  //cout <<endl<< ni << endl;
  cout << m-1-ni << endl;
  while(p.size())p.pop_back();
  while(s.size())s.pop_back();
  }
  return 0;
}

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

int main() {
  int m, n_mi, n_ma;
  while (cin >> m >> n_mi >> n_ma, m || n_mi || n_ma) {
    vector<int> p(m);
    for (int i = 0; i < m; ++i) {
      cin >> p[i];
    }
    int ma = -1;
    int res;
    for (int i = n_mi; i <= n_ma; ++i) {
      if (ma <= abs(p[i - 1] - p[i])) {
        ma = p[i - 1] - p[i];
        res = i;
      }
    }
    cout << res << endl;
  }
}

C++: #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>

#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

int main(void){
    
    int student = 0;
    int maxN,minN = 0;
    int gap = 0,gapMax = 0,gapnumber  = 0;
    int score[1020] = {0};
    
    while(cin >> student >>minN >>maxN,student+maxN+minN)
    {
        REP(i,student)
        cin >> score[i];
  
    
    FOR(j,minN,maxN+1)
        {
            gap = score[0] - score[j];
            if(gapMax <= gap)
            {
                gapnumber = j;
                gapMax = gap;
                
            }
        }
        cout << gapnumber << endl;
    
    }
    return 0;
}