#include <bits/stdc++.h>
using namespace std;
long long N, Q, vals[300005], ans, val;
long long treemn[300005 * 8];
long long treemx[300005 * 8];
long long treesm[300005 * 8];
long long lazy[300005 * 8];
void updLazy(long long x, long long l, long long r) {
  if (!lazy[x]) return;
  treemx[x] = treemn[x] = lazy[x];
  treesm[x] = (r - l + 1) * treemx[x];
  lazy[2 * x + 1] = lazy[x];
  lazy[2 * x + 2] = lazy[x];
  lazy[x] = 0;
}
void initTree(long long x, long long l, long long r) {
  if (l == r) {
    treemn[x] = treemx[x] = treesm[x] = vals[l];
    return;
  }
  long long mid = (l + r) / 2;
  initTree(2 * x + 1, l, mid);
  initTree(2 * x + 2, mid + 1, r);
  treemn[x] = min(treemn[2 * x + 1], treemn[2 * x + 2]);
  treemx[x] = max(treemx[2 * x + 1], treemx[2 * x + 2]);
  treesm[x] = treesm[2 * x + 1] + treesm[2 * x + 2];
}
void upd(long long x, long long l, long long r, long long lq, long long rq,
         long long v) {
  updLazy(x, l, r);
  if (l > rq or r < lq) return;
  if (treemn[x] >= v) return;
  if (l >= lq && r <= rq && treemx[x] <= v) {
    lazy[x] = v;
    updLazy(x, l, r);
    return;
  }
  long long mid = (l + r) / 2;
  upd(2 * x + 1, l, mid, lq, rq, v);
  upd(2 * x + 2, mid + 1, r, lq, rq, v);
  treemn[x] = min(treemn[2 * x + 1], treemn[2 * x + 2]);
  treemx[x] = max(treemx[2 * x + 1], treemx[2 * x + 2]);
  treesm[x] = treesm[2 * x + 1] + treesm[2 * x + 2];
}
void qry(long long x, long long l, long long r, long long lq, long long rq) {
  updLazy(x, l, r);
  if (l > rq or r < lq) return;
  if (val < treemn[x]) return;
  if (l >= lq && r <= rq && treesm[x] <= val) {
    ans += r - l + 1;
    val -= treesm[x];
    return;
  }
  long long mid = (l + r) / 2;
  qry(2 * x + 1, l, mid, lq, rq);
  qry(2 * x + 2, mid + 1, r, lq, rq);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N >> Q;
  for (long long i = 1; i <= N; i++) cin >> vals[i];
  initTree(0, 1, N);
  while (Q--) {
    long long t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      upd(0, 1, N, 1, x, y);
    } else {
      ans = 0;
      val = y;
      qry(0, 1, N, x, N);
      cout << ans << "\n";
    }
  }
  return 0;
}
