#include <bits/stdc++.h>
using namespace std;
template <class t>
inline t read(t &x) {
  char c = getchar();
  bool f = 0;
  x = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0)
    putchar('-'), write(-x);
  else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
const int N = 2e5 + 5;
long long tr[N << 2];
int mi[N << 2], ma[N << 2], tg[N << 2], n, m;
void pushup(int x) {
  tr[x] = tr[x << 1] + tr[x << 1 | 1];
  mi[x] = min(mi[x << 1], mi[x << 1 | 1]);
  ma[x] = max(ma[x << 1], ma[x << 1 | 1]);
}
void tomax(int x, int l, int r, int v) {
  ma[x] = mi[x] = tg[x] = v;
  tr[x] = 1ll * (r - l + 1) * v;
}
void pushdown(int x, int l, int r) {
  if (!tg[x]) return;
  int mid = l + r >> 1;
  tomax(x << 1, l, mid, tg[x]);
  tomax(x << 1 | 1, mid + 1, r, tg[x]);
  tg[x] = 0;
}
void build(int x, int l, int r) {
  if (l == r) {
    mi[x] = ma[x] = read(tr[x]);
    return;
  }
  int mid = l + r >> 1;
  build(x << 1, l, mid);
  build(x << 1 | 1, mid + 1, r);
  pushup(x);
}
void up(int x, int l, int r, int p, int q, int v) {
  if (p <= l && r <= q) {
    if (mi[x] >= v) return;
    if (ma[x] <= v) {
      tomax(x, l, r, v);
      return;
    }
  }
  pushdown(x, l, r);
  int mid = l + r >> 1;
  if (p <= mid) up(x << 1, l, mid, p, q, v);
  if (q > mid) up(x << 1 | 1, mid + 1, r, p, q, v);
  pushup(x);
}
int bin1(int x, int l, int r, int p, int q, int v) {
  if (mi[x] > v) return -1;
  if (l == r) return l;
  pushdown(x, l, r);
  int mid = l + r >> 1;
  if (p <= mid) {
    int res = bin1(x << 1, l, mid, p, q, v);
    if (~res) return res;
  }
  if (q > mid) return bin1(x << 1 | 1, mid + 1, r, p, q, v);
}
int bin2(int x, int l, int r, long long v) {
  if (l == r) {
    if (tr[x] <= v) return l;
    return l - 1;
  }
  pushdown(x, l, r);
  int mid = l + r >> 1;
  if (tr[x << 1] <= v) return bin2(x << 1 | 1, mid + 1, r, v - tr[x << 1]);
  return bin2(x << 1, l, mid, v);
}
long long que(int x, int l, int r, int p, int q) {
  if (q < p) return 0ll;
  if (p <= l && r <= q) return tr[x];
  pushdown(x, l, r);
  int mid = l + r >> 1;
  long long res = 0;
  if (p <= mid) res += que(x << 1, l, mid, p, q);
  if (q > mid) res += que(x << 1 | 1, mid + 1, r, p, q);
  return res;
}
void doit() {
  int o, x, y;
  read(o, x, y);
  if (o == 1) {
    up(1, 1, n, 1, x, y);
  } else {
    int ans = 0;
    while (x <= n) {
      x = bin1(1, 1, n, x, n, y);
      if (x == -1) break;
      int pos = bin2(1, 1, n, y + que(1, 1, n, 1, x - 1));
      ans += pos - x + 1;
      y -= que(1, 1, n, x, pos);
      x = pos + 2;
    }
    write(ans);
    puts("");
  }
}
signed main() {
  read(n, m);
  build(1, 1, n);
  while (m--) doit();
}
