#include<iostream> #include<cstring> #include<cstdio> #include<cmath> using namespace std; #define N 305 int n,a[N],b[N];//把边长当做中心到顶点的距离 int L[N],R[N]; int main(){ while(scanf("%d",&n) && n){ for(int i=1;i<=n;i++)cin>>a[i]; b[1]=a[1]; for(int i=2;i<=n;i++){ int pos=a[i]; for(int j=1;j<i;j++){ if(a[j]<a[i])pos=max(pos,b[j]+2*a[j]); else pos=max(pos,b[j]+2*a[i]); } b[i]=pos; } //for(int i=1;i<=n;i++)cout<<b[i]<<" "; int nowR=0; for(int i=1;i<=n;i++){ R[i]=nowR; nowR=max(nowR,b[i]+a[i]); } int nowL=0x3f3f3f3f; for(int i=n;i>=1;i--){ L[i]=nowL; nowL=min(nowL,b[i]-a[i]); } int flag=0; for(int i=1;i<=n;i++) if(L[i]>R[i] && R[i]<b[i]+a[i] && L[i]>b[i]-a[i]){ if(flag==0){ cout<<i; flag=1; } else cout<<" "<<i; } puts(""); } }