#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
struct SegTree {
  vector<long long> maxv, sum, lazy;
  int base, idx;
  SegTree(int a, long long arr[]) {
    base = 1;
    while (base < a) base <<= 1;
    maxv.resize(base * 2);
    sum.resize(base * 2);
    lazy.resize(base * 2);
    base--;
    for (int i = 1; i <= a; i++) maxv[base + i] = sum[base + i] = arr[i];
    for (int i = base; i >= 1; i--) {
      maxv[i] = max(maxv[i * 2], maxv[i * 2 + 1]);
      sum[i] = sum[i * 2] + sum[i * 2 + 1];
    }
  }
  void propagate(int ns, int nf, int num) {
    if (lazy[num]) {
      if (ns < nf) {
        lazy[num * 2] = max(lazy[num * 2], lazy[num]);
        lazy[num * 2 + 1] = max(lazy[num * 2 + 1], lazy[num]);
      }
      maxv[num] = max(maxv[num], lazy[num]);
      sum[num] = maxv[num] * (nf - ns + 1);
      lazy[num] = 0;
    }
  }
  void update(long long v, int st, int fn, int ns = 1, int nf = -1,
              int num = 1) {
    if (nf == -1) nf = base + 1;
    propagate(ns, nf, num);
    if (fn < ns || nf < st) return;
    if (st <= ns && nf <= fn) {
      lazy[num] = v;
      propagate(ns, nf, num);
      return;
    }
    int mid = (ns + nf) >> 1;
    update(v, st, fn, ns, mid, num * 2);
    update(v, st, fn, mid + 1, nf, num * 2 + 1);
    maxv[num] = max(maxv[num * 2], maxv[num * 2 + 1]);
    sum[num] = sum[num * 2] + sum[num * 2 + 1];
  }
  int get_st(long long v, int ns = 1, int nf = -1, int num = 1) {
    if (nf == -1) nf = base + 1;
    propagate(ns, nf, num);
    if (v >= maxv[1]) return 0;
    if (ns == nf) return ns;
    int mid = (ns + nf) >> 1;
    if (v < maxv[num * 2 + 1]) return get_st(v, mid + 1, nf, num * 2 + 1);
    return get_st(v, ns, mid, num * 2);
  }
  long long get_fn(long long v, int ns = 1, int nf = -1, int num = 1) {
    if (nf == -1) nf = base + 1;
    propagate(ns, nf, num);
    if (ns == nf) {
      idx = ns;
      if (sum[num] > v) idx--;
      return v;
    }
    int mid = (ns + nf) >> 1;
    propagate(ns, mid, num * 2);
    propagate(mid + 1, nf, num * 2 + 1);
    if (sum[num * 2] <= v && sum[num * 2 + 1])
      return get_fn(v - sum[num * 2], mid + 1, nf, num * 2 + 1);
    return get_fn(v, ns, mid, num * 2);
  }
  long long get_sum(int fn, int ns = 1, int nf = -1, int num = 1) {
    if (nf == -1) nf = base + 1;
    propagate(ns, nf, num);
    if (fn < ns) return 0;
    if (nf <= fn) return sum[num];
    int mid = (ns + nf) >> 1;
    return get_sum(fn, ns, mid, num * 2) +
           get_sum(fn, mid + 1, nf, num * 2 + 1);
  }
};
int n, q;
long long m[200005];
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%lld", &m[i]);
  SegTree st(n, m);
  for (int i = 1; i <= q; i++) {
    int t, x, y, s;
    scanf("%d %d %d", &t, &x, &y);
    if (t == 1) {
      s = st.get_st(y) + 1;
      if (s <= x) st.update(y, s, x);
    } else {
      long long v = y;
      int cnt = 0;
      s = max(x - 1, st.get_st(v));
      while (s < n) {
        if (s > 0) v += st.get_sum(s);
        v = st.get_fn(v);
        cnt += st.idx - s;
        s = max(st.idx, st.get_st(v));
      }
      printf("%d\n", cnt);
    }
  }
  return 0;
}
