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;
int main(){
    int m,n1,n2;
    int p[300];
    while(cin>>m>>n1>>n2,m){
        for(int i=0;i<m;i++) cin>>p[i];
        sort(p,p+m);
        reverse(p,p+m);
        int mx_g=0,mx_m=0;
        for(int i=0;i<m;i++){
            if(i<n1-1 || i>n2-1 || n1-1<0 || n2-1>m-1) continue;
            if(p[i]-p[i+1]>=mx_g){
                mx_g=p[i]-p[i+1];
                mx_m=max(mx_m,i+1);
            }
        }
        cout<<mx_m<<endl;
    }
    return 0;
}

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

int main(){
  int m,n_min,n_max,gap,temp=0;
  while(1){
    cin >> m >> n_min >> n_max;
    if(m==0 && n_min==0 && n_max==0){break;}
    int P[m+1];
    P[0]=-1;
    for(int i=1;i<=m;i++){
      cin >> P[i];
    }
    gap=0;
    for(int i=n_min;i<=n_max;i++){
      if(P[i]-P[i+1]>=gap){
        gap=P[i]-P[i+1];
        temp=i;
      }
    }
    cout << temp << endl;
  }
}

C++: 
#include <iostream>

using namespace std;

int main()
{
    int m, n_min, n_max;
    while (cin >> m >> n_min >> n_max, m)
    {
        int a[m] = {0};
        int gap[m] = {0};
        int MAX = 0;
        int MAX_n = 0;
        for (int i = 0; i < m; i++)
        {
            cin >> a[i];
            if (i > 0)
            {
                gap[i] = a[i - 1] - a[i];
            }
        }
        for (int i = n_min; i < n_max + 1; i++)
        {
            if (gap[i] >= MAX)
            {
                MAX = gap[i];
                MAX_n = i;
            }
        }
        cout << MAX_n << endl;
    }
}

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

int main(void)
{
    int m, nm, nM;

    while (std::cin >> m >> nm >> nM, m) {
        std::vector<int> pts;
        for (int i = 0; i < m; i++) {
            int t;
            std::cin >> t;
            pts.push_back(t);
        }

        std::vector<int> gaps;
        for (int i = nm - 1; i < nM; i++) {
            gaps.push_back(pts[i] - pts[i+1]);
        }

        int max_gap = gaps[0];
        int idx;
        for (int i = 0; i < gaps.size(); i++) {
            if (max_gap <= gaps[i]) {
                idx = i + nm;
            }
        }

        std::cout << idx << std::endl;
    }
    
    return 0;
}

C++: #include "bits/stdc++.h"

#define REP(i, n ,N) for(int i = (n); i < (N); i++)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;

int main(){
	while(1) {
		int m,nmin, nmax;
		cin >> m >> nmin >> nmax;
		if(m==0 && nmin==0 && nmax==0)break;
		int  max = 0, ans;
		vector<int> member(m + 1);
		REP(i,1,m+1){
			cin >> member[i];
		}

		REP(i, nmin, nmax + 1) {
			if (member[i] - member[i + 1] >= max) {
				max = member[i] - member[i + 1];
				ans = i;
			}
		}
		p(ans);
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <tuple>
#include <cassert>
#include <exception>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << endl
static const int INF = 1e+9+7;
ll n,m,l;
string s,t;
int d[200010],dp[1010][1010];
double w[1000],v[1000];
double box[200010];
char field[200][200];

int main(){
  while(1){
    cin >> n >> m >> l;
    if(n == 0 && n == m && m == l)break;
    rep(i,0,n)cin >> d[i];
    m--;l--;
    int gap = 0;
    int ans = 0;
    lep(i,m,l){
      if(d[i] - d[i+1] >= gap){
        gap = d[i] - d[i+1];
        ans = i + 1;
      }
    }
    print(ans);
  }
  return 0;
}

C++: #include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  int m,nmin,nmax;
  int i,j;

  while(true){
    cin>>m>>nmin>>nmax;
    if(m==0 && nmin==0 && nmax==0)break;
    int score[200]={};
    rep(i,m)
      cin>>score[i];
    rep(i,m-1)
      score[i]-=score[i+1];

    pii p[200]={};
    int n=0;
    for(i=nmin-1;i<=nmax-1;i++){
      p[n].first=score[i];
      p[n].second=i+1;
      n++;
    }
    int num=nmax-nmin+1;
    sort(p,p+num);

    cout<<p[num-1].second<<endl;

  }

}

C++: #include "bits/stdc++.h"
using namespace std;
 
typedef long long ll;
typedef pair<int, int> pii;
 
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define debug(x) cout << #x << ": " << x << endl
#define ALL(x) (x).begin(),(x).end()
 
const int INF = 1e9;
const ll LINF = 1e16;
 
int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
 
 
    while(1){
        int m, nmin, nmax;
        cin >> m >> nmin >> nmax;
        if (m == 0 && nmin == 0 && nmax == 0)break;
        vector<int> P(m);
        for (int i = 0; i < m; i++) cin >> P[i];
        int MAX = -1;
        int ret = 0;
        for (int i = nmin; i <= nmax; i++) {
            if (P[i - 1] - P[i] >= MAX) {
                MAX = P[i - 1] - P[i];
                ret = i;
            }
        }
        cout << ret << endl;
    }
     
  return 0;
}