#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3f3f3f3f3f;
const int maxn = 400005;
long long treemax[maxn << 2];
long long treemin[maxn << 2];
long long treesum[maxn << 2];
long long lz[maxn << 2];
void pushup(int rt) {
  treemax[rt] = max(treemax[rt << 1], treemax[rt << 1 | 1]);
  treemin[rt] = min(treemin[rt << 1], treemin[rt << 1 | 1]);
  treesum[rt] = treesum[rt << 1] + treesum[rt << 1 | 1];
}
void pushdown(int l, int r, int rt) {
  if (lz[rt]) {
    int m = (l + r) >> 1;
    lz[rt << 1] = lz[rt];
    lz[rt << 1 | 1] = lz[rt];
    treesum[rt << 1] = (m - l + 1) * lz[rt];
    treesum[rt << 1 | 1] = (r - m) * lz[rt];
    treemax[rt << 1] = lz[rt];
    treemax[rt << 1 | 1] = lz[rt];
    treemin[rt << 1] = lz[rt];
    treemin[rt << 1 | 1] = lz[rt];
    lz[rt] = 0;
  }
}
void build(int l, int r, int rt) {
  if (l == r) {
    cin >> treesum[rt];
    treemax[rt] = treemin[rt] = treesum[rt];
    return;
  }
  int m = (l + r) >> 1;
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
  pushup(rt);
}
void updata(int L, int R, long long add, int l, int r, int rt) {
  if (l > R || r < L) return;
  if (treemin[rt] >= add) {
    return;
  }
  if (L <= l && R >= r) {
    if (add > treemax[rt]) {
      treemax[rt] = treemin[rt] = add;
      treesum[rt] = add * (r - l + 1);
      lz[rt] = add;
      return;
    }
  }
  pushdown(l, r, rt);
  int m = (l + r) >> 1;
  updata(L, R, add, l, m, rt << 1);
  updata(L, R, add, m + 1, r, rt << 1 | 1);
  pushup(rt);
}
long long query(int L, int R, int l, int r, int rt, long long &y) {
  if (l > R || r < L) return 0;
  if (treemin[rt] > y) {
    return 0;
  }
  if (L <= l && r <= R && treesum[rt] <= y) {
    y -= treesum[rt];
    return r - l + 1;
  }
  int m = (l + r) >> 1;
  pushdown(l, r, rt);
  return query(L, R, l, m, rt << 1, y) + query(L, R, m + 1, r, rt << 1 | 1, y);
}
void solve() {
  long long n, m;
  cin >> n >> m;
  build(1, n, 1);
  while (m--) {
    long long q, x, y;
    cin >> q >> x >> y;
    if (q == 1) {
      updata(1, x, y, 1, n, 1);
    } else {
      cout << query(x, n, 1, n, 1, y) << endl;
    }
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
}
