#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 1e2;
void fin() {}
const bool flag = 0;
const int N = 2e5 + 10;
ll t[N << 2], tag[N << 2], mn[N << 2], a[N], n;
void build(int u = 0, int l = 0, int r = n) {
  if (r - l == 1) {
    t[u] = a[l];
    mn[u] = a[l];
    return;
  }
  int m = l + r >> 1;
  build(u + u + 1, l, m);
  build(u + u + 2, m, r);
  t[u] = t[u + u + 1] + t[u + u + 2];
  mn[u] = min(mn[u + u + 1], mn[u + u + 2]);
}
void push(int u, int l, int r) {
  if (r - l == 1 || !tag[u]) return;
  int m = l + r >> 1;
  t[u + u + 1] = tag[u] * (m - l);
  t[u + u + 2] = tag[u] * (r - m);
  mn[u + u + 1] = tag[u];
  mn[u + u + 2] = tag[u];
  tag[u + u + 1] = tag[u];
  tag[u + u + 2] = tag[u];
  tag[u] = 0;
}
void modify(int l, int r, int first, int u = 0, int ul = 0, int ur = n) {
  push(u, ul, ur);
  if (l >= ur || ul >= r) return;
  if (l <= ul && ur <= r) {
    t[u] = first * 1ll * (ur - ul);
    mn[u] = first;
    tag[u] = first;
    return;
  }
  int um = ul + ur >> 1;
  modify(l, r, first, u + u + 1, ul, um);
  modify(l, r, first, u + u + 2, um, ur);
  t[u] = t[u + u + 1] + t[u + u + 2];
  mn[u] = min(mn[u + u + 1], mn[u + u + 2]);
}
int second;
int get(int l, int u = 0, int ul = 0, int ur = n) {
  push(u, ul, ur);
  if (l >= ur || mn[u] > second) return 0;
  if (t[u] <= second && l <= ul) {
    second -= t[u];
    return ur - ul;
  }
  int um = ul + ur >> 1;
  return get(l, u + u + 1, ul, um) + get(l, u + u + 2, um, ur);
}
int getpos(int pos, int u = 0, int l = 0, int r = n) {
  push(u, l, r);
  if (r - l == 1) return t[u];
  int m = l + r >> 1;
  if (pos < m)
    return getpos(pos, u + u + 1, l, m);
  else
    return getpos(pos, u + u + 2, m, r);
}
void ma1n() {
  int q;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  build();
  for (int t, first; q--;) {
    cin >> t >> first >> second;
    if (t == 1) {
      int l = 0;
      int r = first - 1;
      int pos = first;
      while (l <= r) {
        int m = l + r >> 1;
        if (getpos(m) < second) {
          pos = m, r = m - 1;
        } else {
          l = m + 1;
        }
      }
      if (pos < first) modify(pos, first, second);
    } else {
      cout << get(first - 1) << "\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr), fin();
  int ts = 1;
  if (flag) {
    cin >> ts;
  }
  while (ts--) {
    ma1n();
  }
  return 0;
}
