#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const long long mod = 998244353;
const int inf = 1 << 31;
const int maxn = 1 << 18;
struct nd {
  long long su, mx, mi, lazy;
} segT[maxn * 4];
int n;
int a[maxn];
void push(int idx, int l, int r) {
  if (segT[idx].lazy) {
    segT[idx].su = segT[idx].lazy * 1LL * (r - l + 1);
    segT[idx].mi = segT[idx].lazy;
    segT[idx].mx = segT[idx].lazy;
    if (l != r) {
      segT[idx << 1].lazy = segT[idx].lazy;
      segT[(idx << 1) | 1].lazy = segT[idx].lazy;
    }
    segT[idx].lazy = 0;
  }
}
void merge(int idx, int lidx, int ridx) {
  segT[idx].mi = min(segT[lidx].mi, segT[ridx].mi);
  segT[idx].mx = max(segT[lidx].mx, segT[ridx].mx);
  segT[idx].su = segT[lidx].su + segT[ridx].su;
}
void updateSeg(int x, int y, int v, int idx = 1, int l = 0, int r = n - 1) {
  push(idx, l, r);
  if (x > r || y < l || segT[idx].mi >= v) return;
  if (x <= l && y >= r && segT[idx].mx <= v) {
    segT[idx].lazy = v;
    push(idx, l, r);
    return;
  }
  int mid = (l + r) >> 1, lidx = idx << 1, ridx = lidx | 1;
  updateSeg(x, y, v, lidx, l, mid);
  updateSeg(x, y, v, ridx, mid + 1, r);
  merge(idx, lidx, ridx);
}
long long querySeg(int x, int y, int &v, int idx = 1, int l = 0,
                   int r = n - 1) {
  push(idx, l, r);
  if (x > r || y < l || segT[idx].mi > v) return 0;
  if (x <= l && y >= r && segT[idx].su <= v) {
    v -= segT[idx].su;
    return (r - l + 1);
  }
  int mid = (l + r) >> 1, lidx = idx << 1, ridx = lidx | 1;
  return querySeg(x, y, v, lidx, l, mid) + querySeg(x, y, v, ridx, mid + 1, r);
}
void build(int idx = 1, int l = 0, int r = n - 1) {
  if (l == r) {
    segT[idx].su = segT[idx].mi = segT[idx].mx = a[l];
    segT[idx].lazy = 0;
    return;
  }
  int mid = (l + r) >> 1, lidx = idx << 1, ridx = lidx | 1;
  build(lidx, l, mid);
  build(ridx, mid + 1, r);
  merge(idx, lidx, ridx);
}
void solve() {
  int q;
  cin >> n >> q;
  for (int i = 0; i < (int)(n); ++i) cin >> a[i];
  build();
  while (q--) {
    int t, x, y;
    cin >> t >> x >> y;
    if (t == 1)
      updateSeg(0, --x, y);
    else
      cout << querySeg(--x, n - 1, y) << "\n";
  }
}
int main() {
  int tc = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (int tt = 0; tt < (int)(tc); ++tt) {
    solve();
  }
}
