#include <bits/stdc++.h>
using namespace std;
const long long maxn = 4e5 + 100;
struct node {
  long long mx, mn;
  long long sum;
} tree[maxn * 4];
long long a[maxn], lazy[maxn];
void pushup(long long now) {
  tree[now].mx = max(tree[now << 1].mx, tree[now << 1 | 1].mx);
  tree[now].mn = min(tree[now << 1].mn, tree[now << 1 | 1].mn);
  tree[now].sum = tree[now << 1].sum + tree[now << 1 | 1].sum;
}
void pushdown(long long now, long long l, long long r) {
  if (lazy[now] != 0) {
    long long mid = (l + r) >> 1;
    tree[now << 1].mn = lazy[now];
    tree[now << 1 | 1].mn = lazy[now];
    tree[now << 1].mx = lazy[now];
    tree[now << 1 | 1].mx = lazy[now];
    tree[now << 1].sum = lazy[now] * (mid - l + 1);
    tree[now << 1 | 1].sum = lazy[now] * (r - mid);
    lazy[now << 1 | 1] = lazy[now];
    lazy[now << 1] = lazy[now];
    lazy[now] = 0;
  }
}
void build(long long now, long long l, long long r) {
  long long mid = (l + r) >> 1;
  if (l == r) {
    tree[now].mx = tree[now].mn = a[l];
    tree[now].sum = a[l];
    return;
  }
  build(now << 1, l, mid);
  build(now << 1 | 1, mid + 1, r);
  pushup(now);
}
void up(long long now, long long l, long long r, long long L, long long R,
        long long val) {
  long long mid = (l + r) >> 1;
  if (tree[now].mn >= val) return;
  if (L <= l && r <= R && tree[now].mx <= val) {
    tree[now].sum = (r - l + 1) * val;
    lazy[now] = tree[now].mx = tree[now].mn = val;
    return;
  }
  pushdown(now, l, r);
  if (mid >= L) up(now << 1, l, mid, L, R, val);
  if (mid < R) up(now << 1 | 1, mid + 1, r, L, R, val);
  pushup(now);
}
long long val;
long long query(long long now, long long l, long long r, long long pos) {
  long long mid = (l + r) >> 1;
  if (val < tree[now].mn) return 0;
  if (l >= pos && tree[now].sum <= val) {
    val -= tree[now].sum;
    return r - l + 1;
  }
  if (l == r) return 0;
  long long ans = 0;
  pushdown(now, l, r);
  if (pos <= mid) {
    ans += query(now << 1, l, mid, pos);
  }
  ans += query(now << 1 | 1, mid + 1, r, pos);
  return ans;
}
void work() {
  long long n, m;
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  build(1, 1, n);
  long long cmd, x, y;
  while (m--) {
    scanf("%lld%lld%lld", &cmd, &x, &y);
    if (cmd == 1) {
      up(1, 1, n, 1, x, y);
    } else {
      val = y;
      long long ans = query(1, 1, n, x);
      printf("%lld\n", ans);
    }
  }
}
signed main() {
  work();
  return 0;
}
