#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 23;
int t, n, m, q;
int a[N];
int mx[N << 2], se[N << 2], cn[N << 2], tag[N << 2];
long long sum[N << 2];
inline void pushup(int u) {
  const int ls = u << 1, rs = u << 1 | 1;
  sum[u] = sum[ls] + sum[rs];
  if (mx[ls] == mx[rs]) {
    mx[u] = mx[rs];
    se[u] = max(se[ls], se[rs]);
    cn[u] = cn[ls] + cn[rs];
  } else if (mx[ls] > mx[rs]) {
    mx[u] = mx[ls];
    se[u] = max(se[ls], mx[rs]);
    cn[u] = cn[ls];
  } else {
    mx[u] = mx[rs];
    se[u] = max(mx[ls], se[rs]);
    cn[u] = cn[rs];
  }
}
inline void pushtag(int u, int tg) {
  if (mx[u] <= tg) return;
  sum[u] += (1ll * tg - mx[u]) * cn[u];
  mx[u] = tag[u] = tg;
}
inline void pushdown(int u) {
  if (tag[u] == -1) return;
  pushtag(u << 1, tag[u]), pushtag(u << 1 | 1, tag[u]);
  tag[u] = -1;
}
void build(int u = 1, int l = 1, int r = n) {
  tag[u] = -1;
  if (l == r) {
    sum[u] = mx[u] = a[l], se[u] = -1e9 - 10, cn[u] = 1;
    return;
  }
  int mid = (l + r) >> 1;
  build(u << 1, l, mid), build(u << 1 | 1, mid + 1, r);
  pushup(u);
}
void modify_min(int L, int R, int v, int u = 1, int l = 1, int r = n) {
  if (mx[u] <= v) return;
  if (L <= l && r <= R && se[u] < v) return pushtag(u, v);
  int mid = (l + r) >> 1;
  pushdown(u);
  if (L <= mid) modify_min(L, R, v, u << 1, l, mid);
  if (mid < R) modify_min(L, R, v, u << 1 | 1, mid + 1, r);
  pushup(u);
}
int query_max(int L, int R, int u = 1, int l = 1, int r = n) {
  if (L <= l && r <= R) return mx[u];
  int mid = (l + r) >> 1, r1 = -1e9, r2 = -1e9;
  pushdown(u);
  if (L <= mid) r1 = query_max(L, R, u << 1, l, mid);
  if (mid < R) r2 = query_max(L, R, u << 1 | 1, mid + 1, r);
  return max(r1, r2);
}
long long query_sum(int L, int R, int u = 1, int l = 1, int r = n) {
  if (L <= l && r <= R) return sum[u];
  int mid = (l + r) >> 1;
  long long res = 0;
  pushdown(u);
  if (L <= mid) res += query_sum(L, R, u << 1, l, mid);
  if (mid < R) res += query_sum(L, R, u << 1 | 1, mid + 1, r);
  return res;
}
int _query_sum(long long v, int u = 1, int l = 1, int r = n) {
  if (l == r) {
    return l;
  }
  int mid = (l + r) >> 1;
  pushdown(u);
  if (-sum[u << 1] > v)
    return _query_sum(v, u << 1, l, mid);
  else
    return _query_sum(v + sum[u << 1], u << 1 | 1, mid + 1, r);
}
int _query_max(int v, int L, int R, int u = 1, int l = 1, int r = n) {
  if (l == r) return l;
  if (L <= l && r <= R) {
    int mid = (l + r) >> 1;
    if (mx[u << 1] >= v)
      return _query_max(v, L, R, u << 1, l, mid);
    else
      return _query_max(v, L, R, u << 1 | 1, mid + 1, r);
  }
  int mid = (l + r) >> 1, mn = 1e9;
  pushdown(u);
  if (L <= mid && mx[u << 1] >= v)
    mn = min(mn, _query_max(v, L, R, u << 1, l, mid));
  if (mid < R && mx[u << 1 | 1] >= v)
    mn = min(mn, _query_max(v, L, R, u << 1 | 1, mid + 1, r));
  return mn;
}
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i] = -a[i];
  build();
  while (q--) {
    int t, x, y;
    scanf("%d%d%d", &t, &x, &y);
    if (t == 1) {
      modify_min(1, x, -y);
    } else {
      int ans = 0;
      int l = x, r = n;
      while (l <= n) {
        int cur = -query_max(l, l);
        if (cur > y) {
          int L = l, R = n;
          int res = _query_max(-y, L, R);
          if (res > n) break;
          l = res;
        }
        int st = l;
        long long _sum = st > 1 ? query_sum(1, st - 1) : 0;
        if (-query_sum(st, n) <= y) {
          ans += n - st + 1;
          break;
        }
        int res = _query_sum(-_sum + y) - 1;
        ans += res - st + 1;
        l = res + 1;
        y += query_sum(st, res);
      }
      printf("%d\n", ans);
    }
  }
}
