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 <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int main(){

  while(true){
  int n, mn, mx;
  cin >> n >> mn >> mx;

  if(n == 0 && mn == 0 && mx == 0) break;

  vector<int> v(n);
  REP(i,n){
    cin >> v[i];
  }

  //sort(ALL(v), greater<int>());
  int g = 0;
  int ans;
  for(int i = mn; i <= mx && i < n; ++i){
    int tmp = v[i-1] - v[i];
    //cout << i+1 << " " << tmp << " " << g << endl;
    if(tmp >= g){
      g = tmp;
      ans = i;
    }
  }

  cout << ans << 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;
vector<int>ansl;
string s;
int main(){
  int M,N_MIN,N_MAX;

  cin >>M>>N_MIN>>N_MAX;
  while(!((M==0)&&(N_MIN==0)&&(N_MAX==0))){
    vector<int> v;
    for(int i = 0;i<M;i++){
      int x;
      cin >>x;
      v.push_back(x);
    }
    int ans = N_MIN-1;
    int gap = v[N_MIN-1]-v[N_MIN];
    for(int i = N_MIN;i <= N_MAX-1;i++){
      int z = v[i]-v[i+1];
      int mx = gap;
      gap = max(gap,z);
      if(mx != gap){
        ans = i;
      }
      if(mx == z){
          ans = i;
      }
    }
    ansl.push_back(ans+1);
    cin >>M>>N_MIN>>N_MAX;
  }

  for(int i = 0;i<(int)ansl.size();i++){
    cout <<ansl[i]<<endl;
  }
  return 0;
}

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

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	for (int m, min, max; m = in(), min = in() - 1, max = in();) {
		vector<int> v(m), w;
		for (int &p: v)
			p = in();
		int j = 0;
		for (int i = min, m = 0; i < max; i++) {
			int t = v[i] - v[i + 1];
			if (t >= m) {
				j = i;
				m = t;
			}
		}
		outl(j + 1);
	}
}

C++: #include <iostream>
#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define REP(i,n) FOR(i,0,n)
using namespace std;

int main(){
    int m,min,max,gap,gapmax,n;
    while(cin >> m >> min >> max && m != 0){
        int p[m];
        REP(i,m){
            cin >> p[i];
        }
        gapmax = 0;
        FOR(i,min,max+1){
            gap = p[i-1] - p[i];
            if(gap >= gapmax){
                gapmax = gap;
                n = i;
            }
        }
        cout << n << endl;
    }


}

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

int main() {
	
	while(true){
		int m, nmin, nmax;
		cin >> m >> nmin >> nmax;
		
		if(m == 0){
			break;
		}
		
		int a[1000];
		
		for(int i = 0; i < m; i++){
			cin >> a[i];
		}
		
		int mm = 0;
		int ans = 0;
		
		for(int i = nmin; i <= nmax; i++){
			if(a[i - 1] - a[i] >= mm){
				mm = a[i - 1] - a[i];
				ans = i;
			}
		}
		
		cout << ans << endl;
		
	}
	return 0;
}

C++: #include <iostream>
#include <vector>

using namespace std;

int main(void) {
	vector<int> result(0);
	int m;
	int nMin;
	int nMax;
	cin >> m;
	cin >> nMin;
	cin >> nMax;
	while (m != 0 || nMin != 0 || nMax != 0) {
		vector<int> array(0);
		for (int i = 0; i < m; i++) {
			int p;
			cin >> p;
			array.push_back(p);
		}
		int tmp = -1;
		int diffMax = -10000;
		for (int i = nMin - 1; i < nMax; i++) {
			int diff = array[i] - array[i + 1];
			if (diff >= diffMax) {
				diffMax = diff;
				tmp = i + 1;
			}
		}
		result.push_back(tmp);
		cin >> m;
		cin >> nMin;
		cin >> nMax;
	}
	
	for (int &num:result) {
		cout << num << endl;
	}
	
	return 0;
}

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

int main()
{
    vector<int> ans;
    while (1)
    {
        int m, min, max;
        cin >> m >> min >> max;
        if (m + min + max == 0)
        {
            break;
        }

        vector<int> scoreList;
        for (int i = 0; i < m; ++i)
        {
            int input;
            cin >> input;
            scoreList.push_back(input);
        }

        int maxDif = 0, answer = min;
        for (int i = min; i <= max; ++i)
        {
            int dif = scoreList[i - 1] - scoreList[i];

            if (dif >= maxDif)
            {
                maxDif = dif;
                answer = i;
            }
        }

        ans.push_back(answer);
    }

    for (int i = 0; i < ans.size(); ++i)
    {
        cout << ans[i] << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
const double eps=1e-9;
typedef vector<int> vi;
typedef long long ll;
int m,nmn,nmx;
int gap=0;
int p[10005];
int main(void)
{
  while(cin >> m >> nmn >> nmx && m)
    {
      int ans;
      gap=0;
      for(int i=1;i<=m;i++)
	{
	  cin >> p[i];
	}
      for(int i=nmn;i<=nmx;i++)
	{
	  int tmp;
	  tmp=p[i]-p[i+1];
	  if(tmp>=gap)
	    {
	      gap=tmp;
	      ans=i;
	    }
	}
      cout << ans << endl;
    }
  return 0;
}