#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  ~debug() { cerr << endl; }
  template <class c>
  typename enable_if<sizeof dud<c>(0) != 1, debug &>::type operator<<(c i) {
    cerr << boolalpha << i;
    return *this;
  }
  template <class c>
  typename enable_if<sizeof dud<c>(0) == 1, debug &>::type operator<<(c i) {
    return *this << range(begin(i), end(i));
  }
  template <class c, class b>
  debug &operator<<(pair<b, c> d) {
    return *this << "(" << d.first << ", " << d.second << ")";
  }
  template <class c>
  debug &operator<<(rge<c> d) {
    *this << "[";
    for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it;
    return *this << "]";
  }
};
const long double eps = 1e-9;
const int T = 1e5;
const int M = 1e9 + 7;
const long long inf = 1e18;
auto rnd = bind(uniform_int_distribution<int>(1, 5), mt19937(time(0)));
const int N = 2e5 + 1;
int p[4 * N];
long long t[4 * N];
int mx[4 * N];
int n, q;
void push(int v, int tl, int tr) {
  if (p[v] && tl != tr) {
    int tm = (tl + tr) >> 1;
    t[2 * v] = 1ll * p[v] * (tm - tl + 1);
    t[2 * v + 1] = 1ll * p[v] * (tr - tm);
    p[2 * v + 1] = p[2 * v] = p[v];
    mx[2 * v] = mx[2 * v + 1] = p[v];
    p[v] = 0;
  }
}
long long getsum(int l, int r, int v, int tl, int tr) {
  if (tl >= l && tr <= r) {
    return t[v];
  }
  if (tr < l || tl > r) return 0;
  push(v, tl, tr);
  int tm = (tl + tr) >> 1;
  return getsum(l, r, 2 * v, tl, tm) + getsum(l, r, 2 * v + 1, tm + 1, tr);
}
void upd(int l, int r, int vl, int v, int tl, int tr) {
  if (tl >= l && tr <= r) {
    p[v] = vl;
    mx[v] = vl;
    t[v] = 1ll * (tr - tl + 1) * vl;
    return;
  }
  if (tr < l || tl > r) return;
  push(v, tl, tr);
  int tm = (tl + tr) >> 1;
  upd(l, r, vl, 2 * v, tl, tm);
  upd(l, r, vl, 2 * v + 1, tm + 1, tr);
  t[v] = (t[2 * v] + t[2 * v + 1]);
  mx[v] = min(mx[2 * v], mx[2 * v + 1]);
}
int firstlower(int vl, int v, int tl, int tr) {
  if (tl == tr) {
    return tl;
  }
  int tm = (tl + tr) >> 1;
  push(v, tl, tr);
  if (mx[2 * v] <= vl) {
    return firstlower(vl, 2 * v, tl, tm);
  } else if (mx[2 * v + 1] <= vl) {
    return firstlower(vl, 2 * v + 1, tm + 1, tr);
  } else
    return n;
}
int togo(int l, int vl) { return l + (vl / getsum(l, l, 1, 0, n - 1)); }
void go(int &l, int &vl, int &cl) {
  while (int nl = togo(l, vl)) {
    nl = min(nl, n);
    if (nl <= l) break;
    vl -= getsum(l, nl - 1, 1, 0, n - 1);
    cl += nl - l;
    l = nl;
    if (l >= n) break;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ;
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    upd(i, i, x, 1, 0, n - 1);
  }
  while (q--) {
    int tp;
    cin >> tp;
    if (tp == 1) {
      int r, y;
      cin >> r >> y;
      r--;
      int l = firstlower(y, 1, 0, n - 1);
      if (l <= r) upd(l, r, y, 1, 0, n - 1);
    } else {
      int l, y;
      cin >> l >> y;
      l--;
      int cl = 0;
      while (l != n) {
        int pl = l;
        go(l, y, cl);
        if (l == n) break;
        l = firstlower(y, 1, 0, n - 1);
        if (l == n) break;
      }
      cout << cl << '\n';
    }
  }
  return 0;
}
