#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return f == 1 ? x : -x;
}
inline void print(long long x) {
  if (x < 0) putchar('-'), x = ~x + 1;
  if (x >= 10) print(x / 10);
  putchar((x % 10) | 48);
}
long long n, q;
long long a[200010];
long long sum[800010], minn[800010], tag[800010], maxn[800010];
void pushup(long long p) {
  sum[p] = sum[p << 1] + sum[p << 1 | 1];
  minn[p] = min(minn[p << 1], minn[p << 1 | 1]);
  maxn[p] = max(maxn[p << 1], maxn[p << 1 | 1]);
}
void pushdown(long long p, long long l, long long r) {
  if (tag[p]) {
    tag[p << 1] = tag[p << 1 | 1] = tag[p];
    minn[p << 1] = minn[p << 1 | 1] = maxn[p << 1] = maxn[p << 1 | 1] = tag[p];
    long long mid = l + r >> 1;
    sum[p << 1] = tag[p] * (mid - l + 1);
    sum[p << 1 | 1] = tag[p] * (r - mid);
    tag[p] = 0;
  }
}
void build(long long p, long long l, long long r) {
  if (l == r) {
    sum[p] = minn[p] = maxn[p] = a[l];
    return;
  }
  long long mid = l + r >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
void update(long long p, long long l, long long r, long long L, long long R,
            long long k) {
  if (L > R) return;
  if (minn[p] > k) return;
  if (l >= L && r <= R && maxn[p] <= k) {
    sum[p] = k * (r - l + 1);
    minn[p] = maxn[p] = k;
    tag[p] = k;
    return;
  }
  pushdown(p, l, r);
  long long mid = l + r >> 1;
  if (L <= mid) update(p << 1, l, mid, L, R, k);
  if (R > mid) update(p << 1 | 1, mid + 1, r, L, R, k);
  pushup(p);
}
long long query(long long p, long long l, long long r, long long L,
                long long &k) {
  if (minn[p] > k) return 0;
  if (sum[p] <= k && l >= L && r <= n) {
    k -= sum[p];
    return r - l + 1;
  }
  if (l == r) return 0;
  pushdown(p, l, r);
  long long mid = l + r >> 1;
  long long res = 0;
  if (L <= mid) res += query(p << 1, l, mid, L, k);
  return res + query(p << 1 | 1, mid + 1, r, L, k);
}
signed main() {
  memset(minn, 0x3f, sizeof(minn));
  n = read(), q = read();
  for (long long i = 1; i <= n; ++i) a[i] = read();
  a[0] = 0x3f3f3f3f, a[n + 1] = 0;
  build(1, 0, n + 1);
  while (q--) {
    long long op = read();
    long long x = read(), y = read();
    if (op == 1) {
      update(1, 0, n + 1, 1, x, y);
    } else {
      printf("%d\n", query(1, 0, n + 1, x, y));
    }
  }
  return 0;
}
