#include using namespace std; struct node{ int l,r; long long t,num; }tree[400005]; long long n,d,k,ans=0,ansn,ansm,a[400005]; void pushup(int rt){ tree[rt].t=max(tree[2*rt].t,tree[2*rt+1].t); tree[rt].num=(tree[rt].t==tree[2*rt].t)?tree[2*rt].num:tree[2*rt+1].num; } void build(int rt,int l,int r){ tree[rt].l=l; tree[rt].r=r; if(l==r){ tree[rt].t=a[l]; tree[rt].num=l; return; }build(2*rt,l,(l+r)/2); build(2*rt+1,(l+r)/2+1,r); pushup(rt); } node cha(int rt,int L,int R){ if(L<=tree[rt].l&&R>=tree[rt].r) return tree[rt]; node kk;kk.t=-2147483647; int mid=(tree[rt].r+tree[rt].l)/2; if(L<=mid) kk=cha(rt*2,L,R); if(R>=mid+1){ node ch=cha(rt*2+1,L,R); if(ch.t>kk.t) kk=ch; }return kk; } int main(){ // freopen("stock.in","r",stdin); // freopen("stock.out","w",stdout); cin>>n>>d>>k; for(int i=1;i<=n;i++) scanf("%d",&a[i]); build(1,1,n); for(int i=1;i<=n-1;i++){ node nd=cha(1,i+1,min(i+d,n)); if(ans