#include<bits/stdc++.h>
using namespace std;
#define fp(i,l,r) for(register int (i)=(l);(i)<=(r);++(i))
#define fd(i,l,r) for(register int (i)=(l);(i)>=(r);--(i))
#define fe(i,u) for(register int (i)=front[(u)];(i);(i)=e[(i)].next)
#define mem(a) memset((a),0,sizeof (a))
#define O(x) cerr<<#x<<':'<<x<<endl
inline int read(){
    int x=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
    while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
    return x*f;
}
void wr(int x){
    if(x<0)putchar('-'),x=-x;
    if(x>=10)wr(x/10);
    putchar('0'+x%10);
}
const int MAXN=20010;
int n,Q,a[MAXN],b[31],st[15][MAXN],c[15][31][MAXN],lg[MAXN];
inline int gpos(int x,int y){
	return x+a[x]<y+a[y]?y:x;
}
inline int ask(int l,int r){
	const int L=lg[r-l+1];
	return gpos(st[L][l],st[L][r-(1<<L)+1]);
}
main(){
	n=read();Q=read();
	fp(i,1,n)a[i]=min(read(),n-i);
	fp(i,2,n)lg[i]=lg[i/2]+1;
	fp(i,1,n)st[0][i]=i;
	fp(i,1,14)
	fp(j,1,n-(1<<i)+1)
	st[i][j]=gpos(st[i-1][j],st[i-1][j+(1<<i-1)]);
	fp(i,1,n){
		c[0][0][i]=ask(i,i+a[i]);
		fp(j,1,30)c[0][j][i]=min(c[0][0][i]+j,n);
	}
	fp(i,1,14){
		fp(j,0,30)fp(k,0,30-j)fp(l,1,n)
		c[i][j+k][l]=gpos(c[i][j+k][l],c[i-1][j][c[i-1][k][l]]);
	}
	while(Q--){
		int l=read(),r=read(),K=read();
		if(l==r){puts("0");continue;}
		if(l+a[l]+K>=r){puts("1");continue;}
		fp(i,0,K)b[i]=l;int ans=0;
		fd(i,14,0){
			fp(j,0,K)fp(k,0,K-j){
				int t=c[i][j][b[k]];
				if(t+a[t]+K-j-k>=r)goto ss;
			}
			ans+=1<<i;
			fd(j,K,0)fd(k,K-j,0)
			b[j+k]=gpos(b[j+k],c[i][k][b[j]]);
			ss:;
		}
		wr(ans+2);putchar('\n');
	}
	return 0;
}