#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[200005];
struct node {
  int l, r;
  long long Maxval, Minval, sum, laze;
} tree[4 * 200005];
void pushup(int x) {
  tree[x].Minval = min(tree[x << 1].Minval, tree[x << 1 | 1].Minval);
  tree[x].Maxval = max(tree[x << 1].Maxval, tree[x << 1 | 1].Maxval);
  tree[x].sum = tree[x << 1].sum + tree[x << 1 | 1].sum;
}
void pushdown(int x) {
  tree[x << 1].Maxval = tree[x << 1].Minval = tree[x].laze;
  tree[x << 1].sum = (tree[x << 1].r - tree[x << 1].l + 1LL) * tree[x].laze;
  tree[x << 1 | 1].Maxval = tree[x << 1 | 1].Minval = tree[x].laze;
  tree[x << 1 | 1].sum =
      (tree[x << 1 | 1].r - tree[x << 1 | 1].l + 1LL) * tree[x].laze;
  tree[x << 1].laze = tree[x << 1 | 1].laze = tree[x].laze;
  tree[x].laze = 0;
}
void build_tree(int x, int l, int r) {
  tree[x].laze = 0;
  tree[x].l = l;
  tree[x].r = r;
  if (l == r) {
    tree[x].Minval = tree[x].Maxval = tree[x].sum = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build_tree(x << 1, l, mid);
  build_tree(x << 1 | 1, mid + 1, r);
  pushup(x);
}
void updata(int x, int l, int r, int y) {
  if (tree[x].l > r || tree[x].r < l) return;
  if (tree[x].Minval >= y) return;
  if (l <= tree[x].l && tree[x].r <= r && tree[x].Maxval < y) {
    tree[x].Maxval = tree[x].Minval = y;
    tree[x].sum = (tree[x].r - tree[x].l + 1LL) * y;
    tree[x].laze = y;
    return;
  }
  if (tree[x].laze) pushdown(x);
  updata(x << 1, l, r, y);
  updata(x << 1 | 1, l, r, y);
  pushup(x);
}
int query(int x, int l, int r, int &y) {
  if (tree[x].l > r || tree[x].r < l || y == 0) return 0;
  if (tree[x].Minval > y) return 0;
  if (l <= tree[x].l && tree[x].r <= r && tree[x].sum <= y) {
    y -= tree[x].sum;
    return tree[x].r - tree[x].l + 1;
  }
  if (tree[x].laze) pushdown(x);
  return query(x << 1, l, r, y) + query(x << 1 | 1, l, r, y);
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  build_tree(1, 1, n);
  while (q--) {
    int t, x, y;
    scanf("%d %d %d", &t, &x, &y);
    if (t == 1) {
      updata(1, 1, x, y);
    } else {
      printf("%d\n", query(1, x, n, y));
    }
  }
  return 0;
}
