#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 20;
const int INF = 1e9 + 7;
int n, m;
long long a[N];
struct Node {
  long long mn, mx, sum, tag;
} t[N << 2];
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void addtag(int p, int len, long long val) {
  t[p].tag = t[p].mx = t[p].mn = val;
  t[p].sum = val * len;
}
inline void pushup(int p) {
  t[p].mn = min(t[p << 1].mn, t[p << 1 | 1].mn);
  t[p].mx = max(t[p << 1].mx, t[p << 1 | 1].mx);
  t[p].sum = t[p << 1].sum + t[p << 1 | 1].sum;
}
inline void pushdown(int p, int l, int mid, int r) {
  if (t[p].tag)
    addtag(p << 1, mid - l + 1, t[p].tag),
        addtag(p << 1 | 1, r - mid, t[p].tag);
  t[p].tag = 0;
}
inline void build(int p, int l, int r) {
  if (l == r) return (void)(t[p].mn = t[p].mx = t[p].sum = a[l]);
  int mid = l + r >> 1;
  build(p << 1, l, mid), build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
inline void modify(int p, int l, int r, int ql, int qr, long long val) {
  if (ql <= l && r <= qr) {
    if (t[p].mn >= val) return;
    if (t[p].mx < val) return (void)addtag(p, r - l + 1, val);
  }
  int mid = l + r >> 1;
  pushdown(p, l, mid, r);
  if (ql <= mid) modify(p << 1, l, mid, ql, qr, val);
  if (qr > mid) modify(p << 1 | 1, mid + 1, r, ql, qr, val);
  pushup(p);
}
inline int query(int p, int l, int r, int ql, int qr, long long &val) {
  if (!val) return 0;
  if (ql <= l && r <= qr) {
    if (val >= t[p].sum) return val -= t[p].sum, r - l + 1;
    if (val < t[p].mn) return 0;
  }
  int mid = l + r >> 1;
  pushdown(p, l, mid, r);
  int ans = 0;
  if (ql <= mid) ans = query(p << 1, l, mid, ql, qr, val);
  if (qr > mid) ans += query(p << 1 | 1, mid + 1, r, ql, qr, val);
  return ans;
}
int main() {
  n = read(), m = read();
  for (register int i = 1, _r = n; i <= _r; ++i) a[i] = read();
  build(1, 1, n);
  while (m--) {
    long long tp = read(), x = read(), y = read();
    if (tp == 1)
      modify(1, 1, n, 1, x, y);
    else
      printf("%d\n", query(1, 1, n, x, n, y));
  }
}
