#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long k;
struct Node {
  long long maxx;
  long long minn;
  long long sum;
} tree[N << 2];
long long lazy[N << 2], a[N << 2];
void push_up(int node) {
  tree[node].maxx = max(tree[node << 1].maxx, tree[node << 1 | 1].maxx);
  tree[node].minn = min(tree[node << 1].minn, tree[node << 1 | 1].minn);
  tree[node].sum = tree[node << 1].sum + tree[node << 1 | 1].sum;
  if (lazy[node << 1] == lazy[node << 1 | 1]) lazy[node] = lazy[node << 1];
}
void push_down(int node, int len) {
  if (lazy[node] != -1) {
    tree[node << 1].maxx = tree[node << 1 | 1].maxx = lazy[node];
    tree[node << 1].minn = tree[node << 1 | 1].minn = lazy[node];
    tree[node << 1].sum = (len - (len >> 1)) * lazy[node];
    tree[node].sum = len * lazy[node];
    tree[node << 1 | 1].sum = (len >> 1) * lazy[node];
    lazy[node << 1] = lazy[node << 1 | 1] = lazy[node];
    lazy[node] = -1;
  }
}
void build(int node, int l, int r) {
  lazy[node] = -1;
  if (l == r) {
    tree[node].maxx = tree[node].minn = a[l];
    tree[node].sum = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(node << 1, l, mid);
  build(node << 1 | 1, mid + 1, r);
  push_up(node);
}
void change(int node, int l, int r, int L, int R) {
  if (L <= l && R >= r) {
    if (k >= tree[node].maxx) {
      lazy[node] = k;
      tree[node].maxx = tree[node].minn = k;
      tree[node].sum = (r - l + 1) * k;
      return;
    }
    if (k <= tree[node].minn) return;
  }
  push_down(node, r - l + 1);
  int mid = (l + r) >> 1;
  if (L <= mid) change(node << 1, l, mid, L, R);
  if (R > mid) change(node << 1 | 1, mid + 1, r, L, R);
  push_up(node);
}
long long query(int node, int l, int r, int L, int R) {
  if (k <= 0) return 0;
  if (L <= l && R >= r) {
    if (k >= tree[node].sum) {
      k -= tree[node].sum;
      return r - l + 1;
    } else if (k < tree[node].minn)
      return 0;
    if (l == r) return 0;
  }
  push_down(node, r - l + 1);
  int mid = (l + r) >> 1;
  long long ans = 0;
  if (L <= mid) ans += query(node << 1, l, mid, L, R);
  if (R > mid) ans += query(node << 1 | 1, mid + 1, r, L, R);
  return ans;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  build(1, 1, n);
  while (q--) {
    int t, x;
    scanf("%d%d%lld", &t, &x, &k);
    if (t == 1) {
      change(1, 1, n, 1, x);
    } else {
      printf("%lld\n", query(1, 1, n, x, n));
    }
  }
  return 0;
}
