#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using namespace std;
const int N = 2e5 + 2;
int n, q, a[N];
int lz[N << 2], mn[N << 2];
ll sum[N << 2];
void build(int id, int l, int r) {
  if (l == r) {
    sum[id] = mn[id] = a[l];
    return;
  }
  int m = (l + r) >> 1;
  build(id << 1, l, m);
  build((id << 1) | 1, m + 1, r);
  sum[id] = sum[id << 1] + sum[(id << 1) | 1];
  mn[id] = mn[(id << 1) | 1];
}
void dolz(int id, int l, int r) {
  if (!lz[id]) return;
  sum[id] = (r - l + 1) * 1LL * lz[id];
  mn[id] = lz[id];
  if (l != r) {
    lz[id << 1] = lz[id];
    lz[(id << 1) | 1] = lz[id];
  }
  lz[id] = 0;
}
int queryF(int id, int l, int r, int v) {
  dolz(id, l, r);
  if (l == r) {
    if (mn[id] > v) return l + 1;
    return l;
  }
  int m = (l + r) >> 1;
  dolz(id << 1, l, m);
  if (mn[id << 1] <= v) return queryF(id << 1, l, m, v);
  return queryF((id << 1) | 1, m + 1, r, v);
}
void update(int id, int l, int r, int L, int R, int v) {
  dolz(id, l, r);
  if (l > R || r < L || L > R) return;
  if (L <= l && r <= R) {
    lz[id] = v;
    dolz(id, l, r);
    return;
  }
  int m = (l + r) >> 1;
  update(id << 1, l, m, L, R, v);
  update((id << 1) | 1, m + 1, r, L, R, v);
  sum[id] = sum[id << 1] + sum[(id << 1) | 1];
  mn[id] = mn[(id << 1) | 1];
}
int cur = 0, ret = 0;
int query1(int id, int l, int r, int v) {
  dolz(id, l, r);
  if (l == r) {
    if (sum[id] > v) return l - 1;
    cur += sum[id];
    return l;
  }
  int m = (l + r) >> 1;
  dolz(id << 1, l, m);
  if (sum[id << 1] < v) {
    cur += sum[id << 1];
    return query1((id << 1) | 1, m + 1, r, v - sum[id << 1]);
  }
  return query1(id << 1, l, m, v);
}
void query(int id, int l, int r, int L, int tot) {
  if (r < L) return;
  dolz(id, l, r);
  if (L <= l) {
    if (cur + sum[id] > tot)
      ret = query1(id, l, r, tot - cur);
    else
      cur += sum[id];
    return;
  }
  int m = (l + r) >> 1;
  query(id << 1, l, m, L, tot);
  if (ret) return;
  query((id << 1) | 1, m + 1, r, L, tot);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> q;
  for (int i = (1); i <= (n); ++i) cin >> a[i];
  build(1, 1, n);
  while (q--) {
    int t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      int p = queryF(1, 1, n, y);
      update(1, 1, n, p, x, y);
    } else {
      int res = 0;
      cur = ret = 0;
      int pL = max(x, queryF(1, 1, n, y));
      query(1, 1, n, pL, y);
      if (ret == 0) ret = n;
      while (ret <= n && pL <= n) {
        y -= cur;
        res += ret - pL + 1;
        pL = max(ret + 1, queryF(1, 1, n, y));
        cur = ret = 0;
        query(1, 1, n, pL, y);
        if (ret == 0) ret = n;
      }
      cout << res << '\n';
    }
  }
  return 0;
}
