#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, q;
long long tag, x, y;
long long a[N];
struct node {
  long long sum;
  int lazy;
} t[N << 2];
inline void push_up(int root) {
  t[root].sum = t[root << 1].sum + t[root << 1 | 1].sum;
}
inline void push_down(int root, int l, int r) {
  t[root].sum = 1ll * (r - l + 1) * t[root].lazy;
  a[l] = a[r] = t[root].lazy;
  if (l < r) {
    t[root << 1].lazy = t[root << 1 | 1].lazy = t[root].lazy;
  }
  t[root].lazy = 0;
}
inline void build(int l, int r, int root) {
  if (l == r) {
    t[root].sum = a[l];
    t[root].lazy = 0;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, root << 1);
  build(mid + 1, r, root << 1 | 1);
  push_up(root);
}
inline void upd(int l, int r, int root, long long x, long long y) {
  if (t[root].lazy) {
    push_down(root, l, r);
  }
  if (l > x || a[r] >= y) return;
  if (a[l] <= y && r <= x) {
    t[root].lazy = y;
    push_down(root, l, r);
    return;
  }
  int mid = (l + r) >> 1;
  upd(l, mid, root << 1, x, y);
  upd(mid + 1, r, root << 1 | 1, x, y);
  push_up(root);
}
long long now;
inline long long query(int l, int r, int root, long long x) {
  if (t[root].lazy) {
    push_down(root, l, r);
  }
  if (r < x || a[r] > now) return 0;
  if (now >= t[root].sum && l >= x) {
    now -= t[root].sum;
    return r - l + 1ll;
  }
  if (l == r) return 0;
  int mid = (l + r) >> 1;
  long long res = query(l, mid, root << 1, x);
  res += query(mid + 1, r, root << 1 | 1, x);
  return res;
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  build(1, n, 1);
  for (int i = 1; i <= q; i++) {
    scanf("%lld%lld%lld", &tag, &x, &y);
    if (tag == 1) {
      upd(1, n, 1, x, y);
    } else {
      now = y;
      printf("%lld\n", query(1, n, 1, x));
    }
  }
  return 0;
}
