#include <bits/stdc++.h>
using namespace std;
int n, q, x, t;
long long a, y, lz[800000], sgt[800000], sgtm[800000];
bool ok;
void update(int p, int lo, int hi, int r, long long v) {
  if (lz[p] >= sgtm[p]) {
    sgtm[p] = lz[p];
    sgt[p] = (hi - lo + 1) * lz[p];
  }
  if (lo > r || lz[p] >= v) return;
  if (hi <= r) {
    lz[p] = v;
    if (lo == hi || sgtm[p] <= v) {
      sgt[p] = (hi - lo + 1) * v;
      sgtm[p] = v;
      return;
    }
    if (sgtm[2 * p + 1] < v) update(2 * p, lo, (lo + hi) / 2, r, v);
    update(2 * p + 1, (lo + hi) / 2 + 1, hi, r, v);
    sgt[p] = sgt[2 * p] + sgt[2 * p + 1];
    return;
  }
  lz[2 * p] = max(lz[2 * p], lz[p]);
  lz[2 * p + 1] = max(lz[2 * p + 1], lz[p]);
  update(2 * p, lo, (lo + hi) / 2, r, v);
  update(2 * p + 1, (lo + hi) / 2 + 1, hi, r, v);
  sgtm[p] = max(sgtm[2 * p], sgtm[2 * p + 1]);
  sgt[p] = sgt[2 * p] + sgt[2 * p + 1];
}
int buscB(int p, int lo, int hi, int v) {
  sgt[p] = max(lz[p] * (hi - lo + 1), sgt[p]);
  sgtm[p] = max(lz[p], sgtm[p]);
  if (hi < v) return 0;
  if (lo < v) {
    lz[2 * p] = max(lz[2 * p], lz[p]);
    lz[2 * p + 1] = max(lz[2 * p + 1], lz[p]);
    int h = buscB(2 * p, lo, (lo + hi) / 2, v);
    if (ok) return h + buscB(2 * p + 1, (lo + hi) / 2 + 1, hi, v);
    return h;
  }
  if (sgt[p] <= y) {
    y -= sgt[p];
    return hi - lo + 1;
  }
  if (lo == hi) {
    ok = false;
    return 0;
  }
  lz[2 * p] = max(lz[2 * p], lz[p]);
  lz[2 * p + 1] = max(lz[2 * p + 1], lz[p]);
  int h = buscB(2 * p, lo, (lo + hi) / 2, v);
  if (ok) return h + buscB(2 * p + 1, (lo + hi) / 2 + 1, hi, v);
  return h;
}
int prox(int p, int lo, int hi, int v) {
  if (hi < v) return hi + 1;
  if (lo < v) {
    sgtm[2 * p] = max(sgtm[2 * p], lz[p]);
    sgtm[2 * p + 1] = max(sgtm[2 * p + 1], lz[p]);
    lz[2 * p] = max(lz[2 * p], lz[p]);
    lz[2 * p + 1] = max(lz[2 * p + 1], lz[p]);
    if ((lo + hi) / 2 < v || sgtm[2 * p + 1] > y)
      return prox(2 * p + 1, (lo + hi) / 2 + 1, hi, v);
    return prox(2 * p, lo, (lo + hi) / 2, v);
  }
  if (sgtm[p] <= y) return lo;
  if (lo == hi) return hi + 1;
  sgtm[2 * p] = max(sgtm[2 * p], lz[p]);
  sgtm[2 * p + 1] = max(sgtm[2 * p + 1], lz[p]);
  lz[2 * p] = max(lz[2 * p], lz[p]);
  lz[2 * p + 1] = max(lz[2 * p + 1], lz[p]);
  if (sgtm[2 * p + 1] > y) return prox(2 * p + 1, (lo + hi) / 2 + 1, hi, v);
  return prox(2 * p, lo, (lo + hi) / 2, v);
}
int binS() {
  int r = 0, lo = prox(1, 1, n, x), mid;
  while (lo <= n) {
    ok = true;
    mid = buscB(1, 1, n, lo);
    r += mid;
    lo = prox(1, 1, n, mid + lo);
  }
  return r;
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &a);
    update(1, 1, n, i + 1, a);
  }
  for (int i = 0; i < q; i++) {
    scanf("%d %d %lld", &t, &x, &y);
    if (t == 1)
      update(1, 1, n, x, y);
    else
      printf("%d\n", binS());
  }
  return 0;
}
