#include <bits/stdc++.h>
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
const int INF = 1e9 + 10;
struct Val {
  int min, len;
  long long int sum;
  Val() {
    min = INF;
    sum = 0;
    len = 0;
  }
  Val(int x) : min(x), sum(x), len(1) {}
  Val &operator+=(const Val &o) {
    min = std::min(min, o.min);
    len += o.len;
    sum += o.sum;
    return *this;
  }
  Val operator+(const Val &o) const { return Val(*this) += o; }
};
struct Mod {
  int replace;
  Mod() : replace(-1) {}
  Mod(int replace) : replace(replace) {}
  Mod operator*(const Mod &o) const {
    if (replace == -1) return o;
    return *this;
  }
  Val operator*(const Val &o) const {
    if (replace == -1) return o;
    Val ans;
    ans.min = replace;
    ans.len = o.len;
    ans.sum = (long long int)ans.min * ans.len;
    return ans;
  }
};
template <class Val, class Mod>
struct segment_tree_lazy {
  struct node {
    Val val;
    Mod mod;
    node *left, *right;
    Val eval() { return mod * val; }
    void pull() {
      mod = Mod();
      val = left->eval() + right->eval();
    }
    void push() {
      left->mod = mod * left->mod;
      right->mod = mod * right->mod;
      mod = Mod();
    }
  };
  int n;
  node *root;
  segment_tree_lazy(int n) { segment_tree_lazy(vector<Val>(n)); }
  segment_tree_lazy(const vector<Val> &a) {
    n = ((int)(a).size());
    root = build(0, n, a);
  }
  node *build(int from, int to, const vector<Val> &a) {
    if (from + 1 == to) return new node({a[from], Mod(), nullptr, nullptr});
    auto ans = new node();
    int mid = (from + to) / 2;
    ans->left = build(from, mid, a);
    ans->right = build(mid, to, a);
    ans->pull();
    return ans;
  }
  void update(node *u, int from, int to, int a, int b, Mod mod) {
    if (to <= a || b <= from) return;
    if (a <= from && to <= b) return void(u->mod = mod * u->mod);
    u->push();
    int mid = (from + to) / 2;
    update(u->left, from, mid, a, b, mod);
    update(u->right, mid, to, a, b, mod);
    u->pull();
  }
  void update(int a, int b, Mod mod) { update(root, 0, n, a, b, mod); }
  Val get(node *u, int from, int to, int a, int b, Mod mod) {
    if (to <= a || b <= from) return Val();
    if (a <= from && to <= b) return mod * u->eval();
    int mid = (from + to) / 2;
    mod = mod * u->mod;
    return get(u->left, from, mid, a, b, mod) +
           get(u->right, mid, to, a, b, mod);
  }
  Val get(int a, int b) { return get(root, 0, n, a, b, Mod()); }
  template <class Cond>
  tuple<int, Val, Val> lower_bound(node *u, int from, int to, Val prefix,
                                   Mod mod, Cond cond) {
    if (from + 1 == to) {
      auto cand = prefix + mod * u->eval();
      if (cond(cand))
        return {from, prefix, cand};
      else
        return {to, cand, cand};
    }
    int mid = (from + to) / 2;
    mod = mod * u->mod;
    auto nprefix = prefix + mod * u->left->eval();
    if (cond(nprefix)) {
      return lower_bound(u->left, from, mid, prefix, mod, cond);
    } else {
      return lower_bound(u->right, mid, to, nprefix, mod, cond);
    }
  }
  template <class Cond>
  tuple<int, Val, Val> lower_bound(Cond cond) {
    return lower_bound(root, 0, n, Val(), Mod(), cond);
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int q;
  int n;
  cin >> n >> q;
  vector<Val> a;
  a.reserve(n);
  for (int i = 0; i < (int)(n); i++) {
    int x;
    cin >> x;
    a.emplace_back(x);
  }
  segment_tree_lazy<Val, Mod> st(a);
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int to, val;
      cin >> to >> val;
      auto [from, _, __] =
          st.lower_bound([&](const Val &a) { return a.min < val; });
      st.update(from, to, Mod(val));
    } else {
      int from, money;
      cin >> from >> money;
      --from;
      long long int from_sum = st.get(0, from).sum;
      int ans = 0;
      while (true) {
        auto [nfrom, v_from, _] =
            st.lower_bound([&](const Val &a) { return a.min <= money; });
        from = max(from, nfrom);
        from_sum = max(from_sum, v_from.sum);
        if (from >= n) break;
        auto cum = from_sum;
        auto [to, v_to, __] =
            st.lower_bound([&](const Val &a) { return a.sum > cum + money; });
        ans += to - from;
        money -= v_to.sum - from_sum;
        assert(money >= 0);
        from = to;
      }
      cout << ans << '\n';
    }
  }
  return 0;
}
