#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  int v = 0, f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void read(long long &x) {
  long long v = 0ll, f = 1ll;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void readc(char &x) {
  char c;
  while (((c = getchar()) == ' ') || c == '\n')
    ;
  x = c;
}
int n, m, i, j, a[200005];
long long sum[800005];
int tag[800005], len[800005], mx[800005], mi[800005];
void pushup(int x) {
  sum[x] = sum[x + x] + sum[x + x + 1];
  mx[x] = max(mx[x + x], mx[x + x + 1]);
  mi[x] = min(mi[x + x], mi[x + x + 1]);
}
void upd(int x, int y) {
  tag[x] = mx[x] = mi[x] = y;
  sum[x] = 1ll * len[x] * y;
}
void pushdo(int x) {
  if (tag[x]) {
    upd(x + x, tag[x]);
    upd(x + x + 1, tag[x]);
    tag[x] = 0;
  }
}
void build(int x, int l, int r) {
  len[x] = r - l + 1;
  if (l == r) {
    sum[x] = mx[x] = mi[x] = a[l];
    tag[x] = a[l];
    return;
  }
  int mid = (l + r) / 2;
  build(x + x, l, mid);
  build(x + x + 1, mid + 1, r);
  pushup(x);
}
void update(int x, int l, int r, int ql, int qr, int c) {
  if (mi[x] >= c) return;
  if (ql <= l && r <= qr && mx[x] <= c) {
    upd(x, c);
    return;
  }
  int mid = (l + r) / 2;
  pushdo(x);
  if (ql <= mid) update(x + x, l, mid, ql, qr, c);
  if (qr > mid) update(x + x + 1, mid + 1, r, ql, qr, c);
  pushup(x);
}
int query(int x, int l, int r, int qr, int &y) {
  if (l >= qr && sum[x] <= y) {
    y -= sum[x];
    return r;
  }
  if (l == r) {
    return l - 1;
  }
  int mid = (l + r) / 2;
  pushdo(x);
  if (qr <= mid) {
    int t = query(x + x, l, mid, qr, y);
    if (t < mid) return t;
  }
  return query(x + x + 1, mid + 1, r, qr, y);
}
int query2(int x, int l, int r, int y) {
  if (mi[x] > y) return r + 1;
  if (l == r) {
    return l;
  }
  int mid = (l + r) / 2;
  pushdo(x);
  int t = query2(x + x, l, mid, y);
  if (t == mid + 1) t = query2(x + x + 1, mid + 1, r, y);
  return t;
}
int main() {
  read(n);
  read(m);
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) read(a[i]);
  build(1, 1, n);
  while (m--) {
    int op, x, y;
    read(op);
    read(x);
    read(y);
    if (op == 1)
      update(1, 1, n, 1, x, y);
    else {
      int t = x, ans = 0;
      int ttt = query(1, 1, n, t, y);
      ans += (ttt - t + 1);
      t = ttt + 1;
      while (t <= n) {
        int tt = query2(1, 1, n, y);
        if (tt > n) break;
        int ttt = query(1, 1, n, tt, y);
        ans += (ttt - tt + 1);
        t = ttt + 1;
      }
      printf("%d\n", ans);
    }
  }
  return 0;
}
