#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int const N = 1e6 + 10;
ll a[N];
struct Node {
  ll maxx{0LL}, minn{0LL}, sum{0LL}, lazy{0LL}, num{0LL};
  Node() = default;
} tree[N];
void pushup(ll rt) {
  tree[rt].sum = tree[rt << 1].sum + tree[rt << 1 | 1].sum;
  tree[rt].maxx = max(tree[rt << 1].maxx, tree[rt << 1 | 1].maxx);
  tree[rt].minn = min(tree[rt << 1].minn, tree[rt << 1 | 1].minn);
}
void pushDown(ll rt) {
  if (tree[rt].lazy) {
    tree[rt << 1].lazy = tree[rt].lazy;
    tree[rt << 1 | 1].lazy = tree[rt].lazy;
    tree[rt << 1].sum = tree[rt << 1].lazy * tree[rt << 1].num;
    tree[rt << 1 | 1].sum = tree[rt << 1 | 1].lazy * tree[rt << 1 | 1].num;
    tree[rt << 1].maxx = tree[rt << 1].minn = tree[rt << 1].lazy;
    tree[rt << 1 | 1].maxx = tree[rt << 1 | 1].minn = tree[rt << 1 | 1].lazy;
    tree[rt].lazy = 0;
  }
}
int build(ll l, ll r, ll rt) {
  if (l == r) {
    tree[rt].sum = tree[rt].maxx = tree[rt].minn = a[l];
    tree[rt].num = 1;
    tree[rt].lazy = 0;
    return 1;
  }
  ll sum = 0;
  ll mid = (l + r) >> 1;
  sum += build(l, mid, rt << 1);
  sum += build(mid + 1, r, rt << 1 | 1);
  pushup(rt);
  tree[rt].num = sum;
  return sum;
}
ll tmpV;
ll query(ll L, ll R, ll l, ll r, ll rt) {
  if (L <= l && r <= R) {
    if (tmpV < tree[rt].minn) return 0;
    if (tmpV >= tree[rt].sum) {
      tmpV -= tree[rt].sum;
      return r - l + 1;
    }
  }
  if (l == r) return 0;
  pushDown(rt);
  ll mid = (l + r) >> 1;
  ll sum = 0;
  if (L <= mid) {
    sum += query(L, R, l, mid, rt << 1);
  }
  if (R > mid) {
    sum += query(L, R, mid + 1, r, rt << 1 | 1);
  }
  return sum;
}
void update(ll L, ll R, ll val, ll l, ll r, ll rt) {
  if (L <= l && r <= R) {
    if (tree[rt].minn >= val) return;
    if (tree[rt].maxx < val) {
      tree[rt].sum = val * (r - l + 1);
      tree[rt].minn = tree[rt].maxx = val;
      tree[rt].lazy = val;
      return;
    }
  }
  if (l == r) return;
  pushDown(rt);
  ll mid = (l + r) >> 1;
  if (L <= mid) update(L, R, val, l, mid, rt << 1);
  if (R > mid) update(L, R, val, mid + 1, r, rt << 1 | 1);
  pushup(rt);
}
int main() {
  ios::sync_with_stdio(false);
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  build(1, n, 1);
  while (q--) {
    ll t, x, y;
    cin >> t >> x >> y;
    if (t == 1) {
      update(1, x, y, 1, n, 1);
    } else if (t == 2) {
      tmpV = y;
      cout << query(x, n, 1, n, 1) << '\n';
    }
  }
  return 0;
}
