#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    que;
stringstream ssin;
const long long LINF = 0x7fffffffffffffffll;
const long long N = 2e5 + 5, M = 4e5 + 5, mod = 1e9 + 7, INF = 0x3f3f3f3f;
long long n, q;
long long a[N];
struct node {
  long long l, r;
  long long maxx, minn, lazy, sum;
} tr[N << 2];
inline long long read() {
  char c = getchar();
  long long x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
void pushup(int u) {
  tr[u].maxx = max(tr[u << 1].maxx, tr[u << 1 | 1].maxx);
  tr[u].minn = min(tr[u << 1].minn, tr[u << 1 | 1].minn);
  tr[u].sum = tr[u << 1].sum + tr[u << 1 | 1].sum;
}
void change(int u, long long num) {
  tr[u].sum = (tr[u].r - tr[u].l + 1) * num;
  tr[u].minn = tr[u].maxx = num;
  tr[u].lazy = num;
}
void pushdown(int u) {
  change(u << 1, tr[u].lazy);
  change(u << 1 | 1, tr[u].lazy);
  tr[u].lazy = 0;
}
void build(int u, int l, int r) {
  tr[u].l = l;
  tr[u].r = r;
  tr[u].lazy = 0;
  if (l == r) {
    tr[u].minn = a[l];
    tr[u].maxx = a[l];
    tr[u].sum = a[l];
    return;
  }
  int mid = l + r >> 1;
  build(u << 1, l, mid);
  build(u << 1 | 1, mid + 1, r);
  pushup(u);
}
void upd(int u, int l, int r, long long val) {
  if (tr[u].minn > val) {
    return;
  }
  if (l <= tr[u].l && tr[u].r <= r) {
    if (tr[u].maxx <= val) {
      change(u, val);
      return;
    }
  }
  if (tr[u].lazy) pushdown(u);
  int mid = tr[u].l + tr[u].r >> 1;
  if (mid >= l) upd(u << 1, l, r, val);
  if (mid + 1 <= r) upd(u << 1 | 1, l, r, val);
  pushup(u);
}
int qry(int u, int l, int r, long long &val) {
  if (tr[u].minn > val) return 0;
  if (tr[u].l >= l && tr[u].r <= r) {
    if (tr[u].sum <= val) {
      val -= tr[u].sum;
      return tr[u].r - tr[u].l + 1;
    }
  }
  if (tr[u].lazy) pushdown(u);
  int mid = tr[u].l + tr[u].r >> 1;
  int ans1 = 0, ans2 = 0;
  if (mid >= l) ans1 = qry(u << 1, l, r, val);
  if (mid + 1 <= r) ans2 = qry(u << 1 | 1, l, r, val);
  return ans1 + ans2;
}
int main() {
  n = read();
  q = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  build(1, 1, n);
  while (q--) {
    long long op, x, y;
    op = read();
    x = read();
    y = read();
    if (op == 1) {
      upd(1, 1, x, y);
    } else if (op == 2) {
      cout << qry(1, x, n, y) << '\n';
    }
  }
}
