#include <bits/stdc++.h>
using namespace std;
long long gi() {
  char cc = getchar();
  long long cn = 0, flus = 1;
  while (cc < '0' || cc > '9') {
    if (cc == '-') flus = -flus;
    cc = getchar();
  }
  while (cc >= '0' && cc <= '9') cn = cn * 10 + cc - '0', cc = getchar();
  return cn * flus;
}
const long long N = 2e5 + 5;
long long n, q, a[N];
struct Tr {
  long long mx, mi, w, tag;
} tr[N << 2];
void pushup(long long x) {
  tr[x].mi = min(tr[(x << 1)].mi, tr[(x << 1 | 1)].mi);
  tr[x].mx = max(tr[(x << 1)].mx, tr[(x << 1 | 1)].mx);
  tr[x].w = tr[(x << 1)].w + tr[(x << 1 | 1)].w;
}
void pushmark(long long x, long long l, long long r) {
  long long u = tr[x].tag, mid = (l + r) >> 1;
  if (!u) return;
  tr[(x << 1)].tag = u, tr[(x << 1 | 1)].tag = u;
  tr[(x << 1)].mx = u, tr[(x << 1)].w = (mid - l + 1) * u,
           tr[(x << 1 | 1)].mx = u, tr[(x << 1 | 1)].w = (r - mid) * u;
  tr[(x << 1)].mi = u, tr[(x << 1 | 1)].mi = u;
  tr[x].tag = 0;
}
long long query(long long x, long long l, long long r, long long k) {
  if (r <= k) return tr[x].w;
  long long mid = (l + r) >> 1;
  pushmark(x, l, r);
  if (mid < k)
    return tr[(x << 1)].w + query((x << 1 | 1), mid + 1, r, k);
  else
    return query((x << 1), l, mid, k);
}
void update(long long x, long long l, long long r, long long ql, long long qr,
            long long k) {
  if (ql <= l && r <= qr) {
    tr[x].mx = tr[x].mi = tr[x].tag = k, tr[x].w = (r - l + 1) * k;
    return;
  }
  if (l > qr || r < ql) return;
  long long mid = (l + r) >> 1;
  pushmark(x, l, r);
  update((x << 1), l, mid, ql, qr, k),
      update((x << 1 | 1), mid + 1, r, ql, qr, k);
  pushup(x);
}
long long Get1(long long x, long long l, long long r, long long S) {
  if (l == r) return (tr[x].mx <= S) ? l : n + 1;
  long long mid = (l + r) >> 1;
  pushmark(x, l, r);
  if (tr[(x << 1)].mi <= S)
    return Get1((x << 1), l, mid, S);
  else
    return Get1((x << 1 | 1), mid + 1, r, S);
}
long long Get2(long long x, long long l, long long r, long long S) {
  if (l == r) return (tr[x].w <= S) ? l : l - 1;
  long long mid = (l + r) >> 1;
  pushmark(x, l, r);
  if (tr[(x << 1)].w > S)
    return Get2((x << 1), l, mid, S);
  else
    return Get2((x << 1 | 1), mid + 1, r, S - tr[(x << 1)].w);
}
void build(long long x, long long l, long long r) {
  if (l == r) return tr[x].w = tr[x].mi = tr[x].mx = a[l], void();
  long long mid = (l + r) >> 1;
  build((x << 1), l, mid), build((x << 1 | 1), mid + 1, r), pushup(x);
}
signed main() {
  n = gi(), q = gi();
  for (register long long i = (1); i <= (n); ++i) a[i] = gi();
  build(1, 1, n);
  long long type, x, k;
  for (register long long i = (1); i <= (q); ++i) {
    type = gi(), x = gi(), k = gi();
    if (type == 1) {
      long long l = Get1(1, 1, n, k);
      if (l > x) continue;
      update(1, 1, n, l, x, k);
    } else {
      long long ans = 0;
      while (233) {
        long long bg = Get1(1, 1, n, k);
        bg = max(bg, x);
        if (bg == n + 1) break;
        long long st = ((bg == 1) ? 0 : query(1, 1, n, bg - 1));
        long long go = Get2(1, 1, n, st + k);
        ans += (go - bg + 1);
        k -= (query(1, 1, n, go) - st), x = go + 1;
      }
      cout << ans << endl;
    }
  }
  return 0;
}
