#include <bits/stdc++.h>
const int mod = 998244353;
const int mod2 = 998244353;
const int maxn = 2e5 + 111;
const int N = 1e6;
using namespace std;
int n, q, a[maxn], mn[4 * maxn], mx[4 * maxn], p[4 * maxn], res, sum;
long long t[4 * maxn];
void build(int v, int tl, int tr) {
  if (tl == tr) {
    t[v] = a[tl];
    mx[v] = a[tl];
    mn[v] = a[tl];
    return;
  }
  int tm = (tl + tr) >> 1;
  build(v << 1, tl, tm);
  build(v << 1 | 1, tm + 1, tr);
  t[v] = t[v << 1] + t[v << 1 | 1];
  mx[v] = max(mx[v << 1], mx[v << 1 | 1]);
  mn[v] = min(mn[v << 1], mn[v << 1 | 1]);
}
void push(int v, int tl, int tr) {
  if (p[v]) {
    p[v << 1] = p[v];
    mn[v << 1] = p[v];
    mx[v << 1] = p[v];
    p[v << 1 | 1] = p[v];
    mn[v << 1 | 1] = p[v];
    mx[v << 1 | 1] = p[v];
    t[v << 1] = 1ll * p[v] * ((tl + tr) / 2 - tl + 1);
    t[v << 1 | 1] = 1ll * p[v] * (tr - (tl + tr) / 2);
    p[v] = 0;
  }
}
void update(int v, int tl, int tr, int l, int r, int cost) {
  if (tr < l || r < tl || l > r || mn[v] >= cost) return;
  if (tl >= l && tr <= r && mx[v] <= cost) {
    t[v] = 1ll * (tr - tl + 1) * cost;
    mn[v] = cost;
    mx[v] = cost;
    p[v] = cost;
    return;
  }
  push(v, tl, tr);
  int tm = (tl + tr) >> 1;
  update(v << 1, tl, tm, l, r, cost);
  update(v << 1 | 1, tm + 1, tr, l, r, cost);
  t[v] = t[v << 1] + t[v << 1 | 1];
  mx[v] = max(mx[v << 1], mx[v << 1 | 1]);
  mn[v] = min(mn[v << 1], mn[v << 1 | 1]);
}
void get(int v, int tl, int tr, int l, int r) {
  if (tr < l || r < tl || l > r || mn[v] > res) return;
  if (tl >= l && tr <= r && t[v] <= res) {
    res -= t[v];
    sum += (tr - tl + 1);
    return;
  }
  push(v, tl, tr);
  int tm = (tl + tr) >> 1;
  get(v << 1, tl, tm, l, r);
  get(v << 1 | 1, tm + 1, tr, l, r);
}
void solve() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  build(1, 1, n);
  while (q--) {
    int type, x, y;
    scanf("%d%d%d", &type, &x, &y);
    if (type == 1)
      update(1, 1, n, 1, x, y);
    else {
      sum = 0;
      res = y;
      get(1, 1, n, x, n);
      printf("%d\n", sum);
    }
  }
}
int main() {
  int qq = 1;
  while (qq--) {
    solve();
  }
}
