#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, q, a[maxn];
long long sum[maxn << 2];
int tag[maxn << 2], val[maxn << 2];
void pushup(int o) {
  val[o] = min(val[(o << 1)], val[(o << 1 | 1)]);
  sum[o] = sum[(o << 1)] + sum[(o << 1 | 1)];
}
void pushdown(int o, int l, int r) {
  if (!tag[o]) return;
  int t = tag[o];
  tag[o] = 0;
  val[(o << 1)] = val[(o << 1 | 1)] = tag[(o << 1)] = tag[(o << 1 | 1)] = t;
  int mid = l + r >> 1;
  sum[(o << 1)] = 1ll * t * (mid - l + 1);
  sum[(o << 1 | 1)] = 1ll * t * (r - mid);
}
void build(int l, int r, int o) {
  if (l == r) return (void)(val[o] = sum[o] = a[l]);
  int mid = l + r >> 1;
  build(l, mid, (o << 1));
  build(mid + 1, r, (o << 1 | 1));
  pushup(o);
}
void update(int L, int R, int p, int l, int r, int o) {
  if (L > r || R < l) return;
  if (L <= l && r <= R)
    return (void)(val[o] = tag[o] = p, sum[o] = 1ll * (r - l + 1) * p);
  pushdown(o, l, r);
  int mid = l + r >> 1;
  if (L <= mid) update(L, R, p, l, mid, (o << 1));
  if (R > mid) update(L, R, p, mid + 1, r, (o << 1 | 1));
  pushup(o);
}
long long qsum(int L, int R, int l, int r, int o) {
  if (L > r || R < l || L > R) return 0;
  if (L <= l && r <= R) return sum[o];
  pushdown(o, l, r);
  int mid = l + r >> 1;
  return qsum(L, R, l, mid, (o << 1)) + qsum(L, R, mid + 1, r, (o << 1 | 1));
}
long long query(long long &s, int l, int r, int o) {
  if (sum[o] <= s) {
    s -= sum[o];
    return r - l + 1;
  }
  if (l == r) return 0;
  pushdown(o, l, r);
  int mid = l + r >> 1, ans = 0;
  if (val[(o << 1)] <= s) ans += query(s, l, mid, (o << 1));
  if (val[(o << 1 | 1)] <= s) ans += query(s, mid + 1, r, (o << 1 | 1));
  return ans;
}
int ask(int w, int l, int r, int o) {
  if (l == r) return l;
  pushdown(o, l, r);
  int mid = l + r >> 1;
  if (val[(o << 1)] > w)
    return ask(w, mid + 1, r, (o << 1 | 1));
  else
    return ask(w, l, mid, (o << 1));
}
int read() {
  int 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;
}
int main() {
  n = read();
  q = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  build(1, n, 1);
  while (q--) {
    int op = read(), x = read();
    long long y = read();
    if (op & 1) {
      int pos = ask(y, 1, n, 1);
      if (pos <= x) update(pos, x, y, 1, n, 1);
    } else
      y += qsum(1, x - 1, 1, n, 1), printf("%d\n", query(y, 1, n, 1) - (x - 1));
  }
  return 0;
}
