#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int N = 200010;
long long a[N];
int n, q;
struct node {
  int l, r;
  long long sum, mn;
  long long lazy;
} tree[N * 4];
void pushup(int u) {
  tree[u].sum = tree[u << 1].sum + tree[u << 1 | 1].sum;
  tree[u].mn = min(tree[u << 1].mn, tree[u << 1 | 1].mn);
}
void pushdown(int u) {
  if (!tree[u].lazy) return;
  tree[u << 1].sum = (tree[u << 1].r - tree[u << 1].l + 1) * tree[u].lazy;
  tree[u << 1 | 1].sum =
      (tree[u << 1 | 1].r - tree[u << 1 | 1].l + 1) * tree[u].lazy;
  tree[u << 1].mn = tree[u << 1 | 1].mn = tree[u].lazy;
  tree[u << 1].lazy = tree[u << 1 | 1].lazy = tree[u].lazy;
  tree[u].lazy = 0;
}
void build(int u, int l, int r) {
  tree[u] = {l, r};
  if (l == r) {
    tree[u].sum = tree[u].mn = a[l];
    return;
  }
  int mid = l + r >> 1;
  build(u << 1, l, mid), build(u << 1 | 1, mid + 1, r);
  pushup(u);
}
void modify(int u, int l, int r, long long val) {
  if (tree[u].l >= l && tree[u].r <= r) {
    tree[u].lazy = tree[u].mn = val;
    tree[u].sum = (tree[u].r - tree[u].l + 1) * val;
    return;
  }
  pushdown(u);
  int mid = tree[u].l + tree[u].r >> 1;
  if (l <= mid) modify(u << 1, l, r, val);
  if (r > mid) modify(u << 1 | 1, l, r, val);
  pushup(u);
}
int findmn(int u, long long val) {
  if (tree[u].l == tree[u].r) {
    if (tree[u].mn > val)
      return tree[u].l + 1;
    else
      return tree[u].l;
  }
  pushdown(u);
  if (tree[u << 1].mn >= val)
    return findmn(u << 1 | 1, val);
  else
    return findmn(u << 1, val);
}
int ans;
int calc(int u, int l, int r, long long now) {
  if (tree[u].r < l || tree[u].l > r || !now) return 0;
  if (tree[u].l >= l && tree[u].r <= r) {
    if (tree[u].sum <= now) {
      ans += tree[u].r - tree[u].l + 1;
      return tree[u].sum;
    }
  }
  long long w = 0;
  if (u < 2 * N) pushdown(u);
  int mid = tree[u].l + tree[u].r >> 1;
  if (l <= mid && u < 2 * N && tree[u << 1].mn <= now)
    w += calc(u << 1, l, r, now);
  if (r > mid && u < 2 * N && tree[u << 1 | 1].mn <= now)
    w += calc(u << 1 | 1, l, r, now - w);
  return w;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie(0);
  int T = 1;
  while (T--) {
    cin >> n >> q;
    for (int i = 1; i <= n; i++) cin >> a[i];
    build(1, 1, n);
    while (q--) {
      int op, x, y;
      cin >> op >> x >> y;
      if (op == 1) {
        int pos = findmn(1, y);
        if (pos <= x) modify(1, pos, x, y);
      } else {
        ans = 0;
        calc(1, x, n, y);
        cout << ans << '\n';
      }
    }
  }
  return 0;
}
