#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll getrnd(ll l, ll r) { return uniform_int_distribution<ll>(l, r)(rng); }
template <typename T1, typename T2>
inline bool relax(T1& a, const T2& b) {
  return a > b ? a = b, true : false;
}
template <typename T1, typename T2>
inline bool strain(T1& a, const T2& b) {
  return a < b ? a = b, true : false;
}
const int N = 2e5 + 3;
int tree[4 * N], lazy[4 * N], a[N], ttl[4 * N], ttr[4 * N];
ll sum[4 * N];
inline void upd(int v, ll x) {
  tree[v] = lazy[v] = x;
  sum[v] = (ttr[v] - ttl[v] + 1) * x;
}
inline void push(int v) {
  if (lazy[v]) {
    upd(2 * v, lazy[v]);
    upd(2 * v + 1, lazy[v]);
    lazy[v] = 0;
  }
}
void build(int v, int tl, int tr) {
  ttl[v] = tl;
  ttr[v] = tr;
  if (tl == tr)
    tree[v] = sum[v] = a[tl];
  else {
    int tm = (tl + tr) / 2;
    build(2 * v, tl, tm);
    build(2 * v + 1, tm + 1, tr);
    tree[v] = min(tree[2 * v], tree[2 * v + 1]);
    sum[v] = sum[2 * v] + sum[2 * v + 1];
  }
}
void update(int v, int tl, int tr, int l, int r, int x) {
  if (l > r) return;
  if (tl == l && tr == r)
    upd(v, x);
  else {
    int tm = (tl + tr) / 2;
    push(v);
    update(2 * v, tl, tm, l, min(r, tm), x);
    update(2 * v + 1, tm + 1, tr, max(l, tm + 1), r, x);
    tree[v] = min(tree[2 * v], tree[2 * v + 1]);
    sum[v] = sum[2 * v] + sum[2 * v + 1];
  }
}
int segsz = 0;
int seg[N];
void getSeg(int v, int tl, int tr, int l, int r) {
  if (l > r) return;
  if (tl == l && tr == r)
    seg[segsz++] = v;
  else {
    int tm = (tl + tr) / 2;
    push(v);
    getSeg(2 * v, tl, tm, l, min(r, tm));
    getSeg(2 * v + 1, tm + 1, tr, max(l, tm + 1), r);
  }
}
int find(int v, int tl, int tr, int x) {
  if (tl == tr)
    return x >= tree[v] ? tl : 1e9;
  else {
    int tm = (tl + tr) / 2;
    push(v);
    if (x >= tree[2 * v])
      return find(2 * v, tl, tm, x);
    else
      return find(2 * v + 1, tm + 1, tr, x);
  }
}
inline int get(int l, int n, int x) {
  segsz = 0;
  getSeg(1, 0, n, l, n);
  for (int i = 0; i < segsz; ++i) {
    int v = seg[i];
    if (x >= tree[v]) return find(v, ttl[v], ttr[v], x);
  }
  return 1e9;
}
int findSum(int v, int tl, int tr, ll s) {
  if (tl == tr)
    return s >= sum[v] ? 1e9 : tl;
  else {
    int tm = (tl + tr) / 2;
    push(v);
    if (s >= sum[2 * v])
      return findSum(2 * v + 1, tm + 1, tr, s - sum[2 * v]);
    else
      return findSum(2 * v, tl, tm, s);
  }
}
inline int getSum(int l, int n, ll s) {
  segsz = 0;
  getSeg(1, 0, n, l, n);
  for (int i = 0; i < segsz; ++i) {
    int v = seg[i];
    if (s < sum[v]) return findSum(v, ttl[v], ttr[v], s);
    s -= sum[v];
  }
  return 1e9;
}
ll segsum(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (tl == l && tr == r)
    return sum[v];
  else {
    int tm = (tl + tr) / 2;
    push(v);
    return segsum(2 * v, tl, tm, l, min(r, tm)) +
           segsum(2 * v + 1, tm + 1, tr, max(l, tm + 1), r);
  }
}
void solve() {
  int n, q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) cin >> a[i];
  build(1, 0, n - 1);
  while (q--) {
    int t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      int st = get(0, n - 1, y);
      update(1, 0, n - 1, st, x - 1, y);
    } else {
      --x;
      int ans = 0;
      while (x < n) {
        int beg = get(x, n - 1, y);
        if (beg >= n) break;
        int en = min(n, getSum(beg, n - 1, y)) - 1;
        if (beg > en) break;
        ans += en - beg + 1;
        y -= segsum(1, 0, n - 1, beg, en);
        x = en + 1;
      }
      cout << ans << '\n';
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  srand(time(0));
  int t = 1;
  while (t--) solve();
  return 0;
}
