#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 2e5 + 200;
struct node {
  long long sum, mn, mx, subval;
} t[4 * N];
long long a[N];
int n, q;
inline void merge(int v) {
  t[v].sum = t[v << 1].sum + t[v << 1 | 1].sum;
  t[v].mn = min(t[v << 1].mn, t[v << 1 | 1].mn);
  t[v].mx = max(t[v << 1].mx, t[v << 1 | 1].mx);
}
inline void push(int v, int tl, int tr) {
  if (tl == tr) return;
  int tm = (tl + tr) / 2;
  if (t[v].subval != 0) {
    t[v << 1].subval = max(t[v << 1].subval, t[v].subval);
    t[v << 1].mx = t[v << 1].subval;
    t[v << 1].mn = t[v << 1].subval;
    t[v << 1].sum = t[v << 1].subval * (long long)(tm - tl + 1);
    t[v << 1 | 1].subval = max(t[v << 1 | 1].subval, t[v].subval);
    t[v << 1 | 1].mx = t[v << 1 | 1].subval;
    t[v << 1 | 1].mn = t[v << 1 | 1].subval;
    t[v << 1 | 1].sum = t[v << 1 | 1].subval * (long long)(tr - tm);
    t[v].subval = 0;
  }
}
void build(int v, int tl, int tr) {
  if (tl == tr) {
    t[v].sum = t[v].mn = t[v].mx = t[v].subval = a[tl];
    return;
  }
  int tm = (tl + tr) / 2;
  build(v << 1, tl, tm);
  build(v << 1 | 1, tm + 1, tr);
  merge(v);
}
void upd(int v, int tl, int tr, int x, long long y) {
  push(v, tl, tr);
  if (t[v].mn >= y || tl > x) return;
  if (tr <= x && t[v].mx <= y) {
    t[v].subval = max(t[v].subval, y);
    t[v].mx = t[v].mn = t[v].subval;
    t[v].sum = t[v].subval * (long long)(tr - tl + 1);
    return;
  }
  if (tl == tr) return;
  int tm = (tl + tr) / 2;
  upd(v << 1, tl, tm, x, y);
  upd(v << 1 | 1, tm + 1, tr, x, y);
  merge(v);
}
int go(int v, int tl, int tr, int x, long long& y) {
  push(v, tl, tr);
  if (tr < x) return 0;
  if (t[v].sum <= y && tl >= x) {
    y -= t[v].sum;
    return tr - tl + 1;
  }
  if (tl == tr || y < t[v].mn) return 0;
  int tm = (tl + tr) / 2;
  return go(v << 1, tl, tm, x, y) + go(v << 1 | 1, tm + 1, tr, x, y);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; i++) cin >> a[i];
  build(1, 0, n - 1);
  while (q--) {
    int t;
    long long x, y;
    cin >> t >> x >> y;
    x--;
    if (t == 1) {
      upd(1, 0, n - 1, x, y);
    } else {
      cout << go(1, 0, n - 1, x, y) << "\n";
    }
  }
}
