#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <typename T>
void chmax(T &x, const T &y) {
  if (x < y) x = y;
}
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
const long long N = 2e5 + 10;
long long n, q;
struct Segment_Tree {
  long long l, r, dat, minn, maxx, tag;
} t[N << 2];
inline void up(long long p) {
  t[p].dat = t[(p << 1)].dat + t[(p << 1 | 1)].dat;
  t[p].minn = t[(p << 1 | 1)].minn;
  t[p].maxx = t[(p << 1)].maxx;
}
inline void down(long long p) {
  if (!t[p].tag) return;
  long long x = t[p].tag;
  t[p].tag = 0;
  t[(p << 1)].tag = t[(p << 1 | 1)].tag = x;
  t[(p << 1)].maxx = t[(p << 1 | 1)].minn = t[(p << 1)].minn =
      t[(p << 1 | 1)].maxx = x;
  t[(p << 1)].dat = (t[(p << 1)].r - t[(p << 1)].l + 1) * x;
  t[(p << 1 | 1)].dat = (t[(p << 1 | 1)].r - t[(p << 1 | 1)].l + 1) * x;
}
inline void build(long long p, long long l, long long r) {
  t[p].l = l, t[p].r = r;
  if (l == r) return (void)(t[p].dat = t[p].maxx = t[p].minn = read());
  long long mid = (l + r) >> 1;
  build((p << 1), l, mid), build((p << 1 | 1), mid + 1, r);
  up(p);
}
inline void modify(long long p, long long l, long long r, long long x) {
  if (l <= t[p].l && t[p].r <= r && t[p].maxx <= x) {
    t[p].tag = t[p].maxx = t[p].minn = x;
    t[p].dat = (t[p].r - t[p].l + 1) * x;
    return;
  }
  down(p);
  long long mid = (t[p].l + t[p].r) >> 1;
  if (l <= mid && t[(p << 1)].minn <= x) modify((p << 1), l, r, x);
  if (r > mid && t[(p << 1 | 1)].minn <= x) modify((p << 1 | 1), l, r, x);
  up(p);
}
inline long long query(long long p, long long l, long long r, long long &val) {
  if (l <= t[p].l && t[p].r <= r && val >= t[p].dat) {
    val -= t[p].dat;
    return t[p].r - t[p].l + 1;
  }
  down(p);
  long long mid = (t[p].l + t[p].r) >> 1, res = 0;
  if (l <= mid && t[(p << 1)].minn <= val) res += query((p << 1), l, r, val);
  if (r > mid && t[(p << 1 | 1)].minn <= val)
    res += query((p << 1 | 1), l, r, val);
  return res;
}
signed main() {
  n = read(), q = read();
  build(1, 1, n);
  long long opt, x, y;
  while (q--) {
    opt = read(), x = read(), y = read();
    if (opt == 1)
      modify(1, 1, x, y);
    else
      cout << query(1, x, n, y) << endl;
  }
  return 0;
  ;
}
