#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
int n, q, mx[maxn << 2], a[maxn], cnt[maxn << 2], lazy[maxn << 2],
    mn[maxn << 2];
long long t[maxn << 2];
void merge(int v) {
  mn[v] = min(mn[2 * v], mn[2 * v + 1]);
  mx[v] = max(mx[2 * v], mx[2 * v + 1]);
  t[v] = t[2 * v] + t[2 * v + 1];
}
void apply(int v, int x) {
  lazy[v] = x;
  mn[v] = mx[v] = x;
  t[v] = 1LL * cnt[v] * x;
}
void push(int v, int tl, int tr) {
  if (tl != tr and lazy[v] != 0) {
    apply(2 * v, lazy[v]);
    apply(2 * v + 1, lazy[v]);
  }
  lazy[v] = 0;
}
void build(int v, int tl, int tr) {
  if (tl == tr) {
    mn[v] = a[tl];
    mx[v] = a[tl];
    t[v] = a[tl];
    cnt[v] = 1;
    return;
  }
  int md = (tl + tr) >> 1;
  build(2 * v, tl, md);
  build(2 * v + 1, md + 1, tr);
  cnt[v] = tr - tl + 1;
  merge(v);
}
void do_max(int v, int tl, int tr, int l, int r, int x) {
  if (tr < l or r < tl) return;
  if (mn[v] >= x) return;
  if (tl >= l and tr <= r and mx[v] < x) {
    apply(v, x);
    return;
  }
  push(v, tl, tr);
  int md = (tl + tr) >> 1;
  do_max(2 * v, tl, md, l, r, x);
  do_max(2 * v + 1, md + 1, tr, l, r, x);
  merge(v);
}
int go(int v, int tl, int tr, int l, int r, int& y) {
  push(v, tl, tr);
  if (tl == l and tr == r) {
    if (y >= t[v]) {
      y -= t[v];
      return cnt[v];
    }
    if (mn[v] > y) return 0;
    int md = (tl + tr) >> 1;
    int d1 = go(2 * v, tl, md, l, md, y);
    int d2 = go(2 * v + 1, md + 1, tr, md + 1, r, y);
    return d1 + d2;
  }
  int md = (tl + tr) >> 1;
  if (r <= md)
    return go(2 * v, tl, md, l, r, y);
  else if (l > md)
    return go(2 * v + 1, md + 1, tr, l, r, y);
  else {
    int d1 = go(2 * v, tl, md, l, md, y);
    int d2 = go(2 * v + 1, md + 1, tr, md + 1, r, y);
    return d1 + d2;
  }
}
int main() {
  int t = 1;
  while (t--) {
    cin >> n >> q;
    for (int i = 1; i <= n; i++) cin >> a[i];
    build(1, 1, n);
    while (q--) {
      int type, x, y;
      cin >> type >> x >> y;
      if (type == 1) {
        do_max(1, 1, n, 1, x, y);
      } else {
        cout << go(1, 1, n, x, n, y) << '\n';
      }
    }
  }
  return 0;
}
