#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 5;
long long stmn[4 * maxn], stsum[4 * maxn], lazy[4 * maxn];
long long N, a[maxn], Q;
void push(long long id, long long l, long long r) {
  if (lazy[id] == 0) return;
  stmn[id] = lazy[id];
  stsum[id] = (r - l + 1) * lazy[id];
  if (l != r) {
    lazy[id << 1] = lazy[id];
    lazy[id << 1 | 1] = lazy[id];
  }
  lazy[id] = 0;
}
void pull(long long id) {
  stsum[id] = stsum[id << 1] + stsum[id << 1 | 1];
  stmn[id] = min(stmn[id << 1], stmn[id << 1 | 1]);
}
void build(long long id, long long l, long long r) {
  if (l == r) {
    stmn[id] = stsum[id] = a[l];
    return;
  }
  long long mid = (l + r) / 2;
  build(id << 1, l, mid);
  build(id << 1 | 1, mid + 1, r);
  pull(id);
}
void modify(long long L, long long R, long long v, long long id = 1,
            long long l = 1, long long r = N) {
  push(id, l, r);
  if (R < l || r < L) return;
  if (L <= l && r <= R) {
    lazy[id] = v;
    push(id, l, r);
    return;
  }
  long long mid = (l + r) / 2;
  modify(L, R, v, id << 1, l, mid);
  modify(L, R, v, id << 1 | 1, mid + 1, r);
  pull(id);
}
long long findfirst(long long val, long long id = 1, long long l = 1,
                    long long r = N) {
  push(id, l, r);
  if (stmn[id] > val) return N + 1;
  if (l == r) {
    if (stmn[id] <= val) return l;
    return N + 1;
  }
  long long mid = (l + r) / 2;
  push(id << 1, l, mid);
  push(id << 1 | 1, mid + 1, r);
  if (stmn[id << 1] <= val) return findfirst(val, id << 1, l, mid);
  return findfirst(val, id << 1 | 1, mid + 1, r);
}
long long getval(long long L, long long R, long long id = 1, long long l = 1,
                 long long r = N) {
  push(id, l, r);
  if (R < l || r < L) return 0;
  if (L <= l && r <= R) {
    return stsum[id];
  }
  long long mid = (l + r) / 2;
  return getval(L, R, id << 1, l, mid) + getval(L, R, id << 1 | 1, mid + 1, r);
}
long long findfirstsum(long long val, long long id = 1, long long l = 1,
                       long long r = N) {
  push(id, l, r);
  if (l == r) {
    if (stsum[id] > val) return l;
    return N + 1;
  }
  long long mid = (l + r) / 2;
  push(id << 1, l, mid);
  push(id << 1 | 1, mid + 1, r);
  if (stsum[id << 1] <= val)
    return findfirstsum(val - stsum[id << 1], id << 1 | 1, mid + 1, r);
  return findfirstsum(val, id << 1, l, mid);
}
signed main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> Q;
  for (long long i = 1; i <= N; ++i) {
    cin >> a[i];
  }
  build(1, 1, N);
  for (long long i = 1; i <= Q; ++i) {
    long long type;
    cin >> type;
    long long x, y;
    cin >> x >> y;
    if (type == 1) {
      long long pos = findfirst(y);
      if (pos <= x) modify(pos, x, y);
    } else {
      long long ret = 0;
      while (x <= N && y > 0) {
        x = max(x, findfirst(y));
        long long psum = getval(1, x - 1);
        long long nxtpos = findfirstsum(psum + y);
        if (i == Q) cerr << x << ' ' << y << ' ' << nxtpos << '\n';
        if (nxtpos == x) {
          break;
        } else {
          y -= getval(x, nxtpos - 1);
          ret += nxtpos - x;
          x = nxtpos;
        }
      }
      cout << ret << '\n';
    }
  }
}
