#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int N = 2e5 + 10;
int a[N];
int cnt;
long long ans;
struct node {
  long long l, r;
  long long Mi, Mx, lazy;
  long long sum, len;
} tree[N << 2];
void pushup(int n) {
  tree[n].Mx = max(tree[n << 1].Mx, tree[n << 1 | 1].Mx);
  tree[n].Mi = min(tree[n << 1].Mi, tree[n << 1 | 1].Mi);
  tree[n].sum = tree[n << 1].sum + tree[n << 1 | 1].sum;
}
void pushdown(int n) {
  if (tree[n].lazy) {
    int val = tree[n].lazy;
    tree[n << 1].Mi = tree[n << 1].Mx = tree[n << 1].lazy = val;
    tree[n << 1 | 1].Mi = tree[n << 1 | 1].Mx = tree[n << 1 | 1].lazy = val;
    tree[n << 1].sum = tree[n << 1].len * val;
    tree[n << 1 | 1].sum = tree[n << 1 | 1].len * val;
    tree[n].lazy = 0;
  }
}
void build_tree(int n, int l, int r) {
  tree[n].l = l;
  tree[n].r = r;
  tree[n].lazy = 0;
  tree[n].len = r - l + 1;
  if (l == r)
    tree[n].Mi = tree[n].Mx = tree[n].sum = a[l];
  else {
    long long mid = (l + r) / 2;
    int left_node = 2 * n;
    int right_node = 2 * n + 1;
    build_tree(left_node, l, mid);
    build_tree(right_node, mid + 1, r);
    pushup(n);
  }
}
void update_tree(int n, int l, int r, int val) {
  if (tree[n].Mi >= val) return;
  if (tree[n].l >= l && tree[n].r <= r && tree[n].Mx < val) {
    tree[n].sum = (tree[n].len) * val;
    tree[n].Mi = tree[n].Mx = tree[n].lazy = val;
    return;
  }
  pushdown(n);
  long long mid = (tree[n].l + tree[n].r) / 2;
  if (l <= mid) update_tree(n << 1, l, r, val);
  if (r > mid) update_tree(n << 1 | 1, l, r, val);
  pushup(n);
}
int query_tree(int n, int l, int r) {
  if (tree[n].Mi > cnt) return 0;
  if (tree[n].sum <= cnt && tree[n].l >= l && tree[n].r <= r) {
    cnt -= tree[n].sum;
    return tree[n].len;
  }
  pushdown(n);
  long long mid = (tree[n].l + tree[n].r) / 2;
  int tp = 0;
  if (l <= mid) tp += query_tree(n << 1, l, r);
  if (r > mid) tp += query_tree(n << 1 | 1, l, r);
  return tp;
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) cin >> a[i];
  build_tree(1, 1, n);
  while (m--) {
    int op, x, y;
    scanf("%d%d%d", &op, &x, &y);
    if (op == 1)
      update_tree(1, 1, x, y);
    else
      cnt = y, printf("%d\n", query_tree(1, x, n));
  }
  return 0;
}
