#include<bits/stdc++.h>
using namespace std;
#define Re register int

const int N = 20005;
int n, q, t, ans, a[N], d[32], f[15][32][N];

inline int read()
{
	char c = getchar();
	int ans = 0;
	while (c < 48 || c > 57) c = getchar();
	while (c >= 48 && c <= 57) ans = (ans << 3) + (ans << 1) + (c ^ 48), c = getchar();
	return ans;
}

inline void write(int x)
{
	int num = 0;
	char sc[15];
	while (x) sc[++num] = x % 10 + 48, x /= 10;
	while (num) putchar(sc[num--]);
	putchar('\n');
}

int main()
{
	n = read(), q = read();
	for (Re i = 1; i <= n; ++i) a[i] = i + read();
	for (Re i = 1; i <= n; ++i) f[0][0][i] = (a[i] > a[i + 1]) ? i : i + 1;
	for (Re i = 1; i <= 30; ++i)
		for (Re j = 1; j <= n; ++j) f[0][i][j] = (a[j] > a[f[0][i - 1][j + 1]]) ? j : f[0][i - 1][j + 1];
	for (Re i = 1; (1 << i) <= n; ++i)
	{
		t = i;
		int u = 1 << i;
		for (Re j = 1; j <= n; ++j) f[i][0][j] = (a[f[i - 1][0][j]] > a[f[i - 1][0][f[i - 1][0][j]]]) ? f[i - 1][0][j] : f[i - 1][0][f[i - 1][0][j]];
		for (Re j = 1; j <= 30; ++j)
			for (Re k = 1; k <= n; ++k)
				for (Re t = 0; t <= j; ++t)
				{
					if (a[f[i - 1][t][k]] > a[f[i][j][k]]) f[i][j][k] = f[i - 1][t][k];
					if (a[f[i - 1][j - t][f[i - 1][t][k]]] > a[f[i][j][k]]) f[i][j][k] = f[i - 1][j - t][f[i - 1][t][k]];
				}
	}
	while (q--)
	{
		int u = read(), v = read(), w = read();
		if (u == v)
		{
			puts("0");
			continue;
		}
		if (a[u] + w >= v)
		{
			puts("1");
			continue;
		}
		ans = 0;
		for (Re i = 0; i <= w; ++i) d[i] = f[0][i][u];
		for (Re i = t; i >= 0; --i)
		{
			bool p = 0;
			for (Re j = 0; j <= w && !p; ++j)
				for (Re k = w - j; k >= 0; --k)
					if (a[f[i][k][d[j]]] >= v)
					{
						p = 1;
						break;
					}
			if (p) continue;
			ans |= 1 << i;
			for (Re j = w; j >= 0; --j)
				for (Re k = j; k >= 0; --k)
					if (a[f[i][j - k][d[k]]] > a[d[j]]) d[j] = f[i][j - k][d[k]];
		}
		write(ans + 2);
	}
	return 0;
}
