#include <bits/stdc++.h>
using namespace std;
struct node {
  int mi, mx, lz;
  long long sm;
};
int n, q;
int a[200005];
node tree[4 * 200005];
void bld(int l = 0, int r = n, int p = 1) {
  if (l == r) {
    tree[p].sm = tree[p].mi = tree[p].mx = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  bld(l, mid, p << 1);
  bld(mid + 1, r, p << 1 | 1);
  tree[p].mi = tree[p << 1 | 1].mi;
  tree[p].mx = tree[p << 1].mx;
  tree[p].sm = tree[p << 1].sm + tree[p << 1 | 1].sm;
}
void push(int& l, int& r, int p) {
  if (!tree[p].lz) return;
  tree[p].mi = tree[p].lz;
  tree[p].mx = tree[p].lz;
  tree[p].sm = 1LL * tree[p].lz * (r - l + 1);
  if (l != r) {
    tree[p << 1].lz = tree[p].lz;
    tree[p << 1 | 1].lz = tree[p].lz;
  }
  tree[p].lz = 0;
}
void upd(int qr, int v, int l = 0, int r = n, int p = 1) {
  push(l, r, p);
  if (tree[p].mi >= v) return;
  if (qr < l) return;
  if (r <= qr && tree[p].mx <= v) {
    tree[p].lz = v;
    push(l, r, p);
    return;
  }
  int mid = (l + r) >> 1;
  upd(qr, v, l, mid, p << 1);
  upd(qr, v, mid + 1, r, p << 1 | 1);
  tree[p].mi = tree[p << 1 | 1].mi;
  tree[p].mx = tree[p << 1].mx;
  tree[p].sm = tree[p << 1].sm + tree[p << 1 | 1].sm;
}
pair<int, long long> qry0(int ql, int v, long long bef = 0, int l = 0,
                          int r = n, int p = 1) {
  push(l, r, p);
  if (l == r) return {l, bef};
  int mid = (l + r) >> 1;
  if (ql <= mid && tree[p << 1].mi <= v)
    return qry0(ql, v, bef, l, mid, p << 1);
  push(l, mid, p << 1);
  return qry0(ql, v, bef + tree[p << 1].sm, mid + 1, r, p << 1 | 1);
}
pair<int, long long> qry1(long long lft, int l = 0, int r = n, int p = 1) {
  push(l, r, p);
  if (l == r) return {l, lft};
  int mid = (l + r) >> 1;
  push(l, mid, p << 1);
  if (tree[p << 1].sm <= lft)
    return qry1(lft - tree[p << 1].sm, mid + 1, r, p << 1 | 1);
  return qry1(lft, l, mid, p << 1);
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  bld();
  int t, x, y;
  while (q--) {
    scanf("%d%d%d", &t, &x, &y), x--;
    if (t == 1) {
      upd(x, y);
    } else {
      int ans = 0;
      while (x < n) {
        auto c = qry0(x, y);
        if (c.first >= n) break;
        long long pref = c.second;
        int st = c.first;
        c = qry1(pref + y);
        ans += (c.first - st);
        y = c.second;
        x = c.first;
      }
      printf("%d\n", ans);
    }
  }
}
