#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long N = 2e5 + 5;
long long read() {
  long long s = 0;
  char c = getchar(), lc = '+';
  while (c < '0' || '9' < c) lc = c, c = getchar();
  while ('0' <= c && c <= '9') s = s * 10 + c - '0', c = getchar();
  return lc == '-' ? -s : s;
}
void write(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x < 10)
    putchar(x + '0');
  else {
    write(x / 10);
    putchar(x % 10 + '0');
  }
}
void print(long long x, char c = '\n') {
  write(x);
  putchar(c);
}
struct node {
  long long sum, Max, Min;
} t[N * 4];
node operator+(const node &a, const node &b) {
  node ret;
  ret.sum = a.sum + b.sum;
  ret.Max = max(a.Max, b.Max);
  ret.Min = min(a.Min, b.Min);
  return ret;
}
long long tag[N * 4], a[N];
void build(long long w, long long l, long long r) {
  tag[w] = 0;
  if (l == r) return void(t[w].Max = t[w].Min = t[w].sum = a[l]);
  build((w * 2), l, ((l + r) / 2));
  build((w * 2 + 1), ((l + r) / 2) + 1, r);
  t[w] = t[(w * 2)] + t[(w * 2 + 1)];
}
void cover(long long w, long long x, long long l, long long r) {
  tag[w] = x;
  t[w].sum = x * (r - l + 1);
  t[w].Max = t[w].Min = x;
}
void pushdown(long long w, long long l, long long r) {
  if (!tag[w]) return;
  cover((w * 2), tag[w], l, ((l + r) / 2));
  cover((w * 2 + 1), tag[w], ((l + r) / 2) + 1, r);
  tag[w] = 0;
}
void cover(long long w, long long l, long long r, long long x, long long y) {
  if (l > x) return;
  if (r <= x && t[w].Max <= y) return cover(w, y, l, r);
  if (t[w].Min >= y) return;
  pushdown(w, l, r);
  cover((w * 2), l, ((l + r) / 2), x, y);
  cover((w * 2 + 1), ((l + r) / 2) + 1, r, x, y);
  t[w] = t[(w * 2)] + t[(w * 2 + 1)];
}
long long query(long long w, long long l, long long r, long long x) {
  if (x < l) return 0;
  if (r <= x) return t[w].sum;
  pushdown(w, l, r);
  return query((w * 2), l, ((l + r) / 2), x) +
         query((w * 2 + 1), ((l + r) / 2) + 1, r, x);
}
long long find1(long long w, long long l, long long r, long long y) {
  if (t[w].sum <= y) return r;
  if (t[w].Max > y) return l - 1;
  if (l == r) return l;
  pushdown(w, l, r);
  if (t[(w * 2)].sum <= y)
    return find1((w * 2 + 1), ((l + r) / 2) + 1, r, y - t[(w * 2)].sum);
  return find1((w * 2), l, ((l + r) / 2), y);
}
long long find2(long long w, long long l, long long r, long long y) {
  if (t[w].Min > y) return r + 1;
  if (l == r) return l;
  pushdown(w, l, r);
  if (t[(w * 2)].Min <= y) return find2((w * 2), l, ((l + r) / 2), y);
  return find2((w * 2 + 1), ((l + r) / 2) + 1, r, y);
}
signed main() {
  long long n = read(), m = read();
  for (long long i = 1; i <= n; i++) a[i] = read();
  build(1, 1, n);
  for (long long i = 1; i <= m; i++) {
    long long opt = read(), x = read(), y = read();
    if (opt == 1) cover(1, 1, n, x, y);
    if (opt == 2) {
      x = max(find2(1, 1, n, y), x);
      long long ans = 0;
      while (x <= n) {
        long long nxt = find1(1, 1, n, y + query(1, 1, n, x - 1));
        if (nxt < x) break;
        ans += nxt - x + 1;
        y -= query(1, 1, n, nxt) - query(1, 1, n, x - 1);
        x = max(find2(1, 1, n, y), nxt + 1);
      }
      print(ans);
    }
  }
  return 0;
}
