#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const double PI = acos(-1.0);
inline long long gcd(long long a, long long b) {
  while (b != 0) {
    long long t = b;
    b = a % b;
    a = t;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long inv(long long a, long long m) {
  if (a == 1) return 1;
  return inv(m % a, m) * (m - m / a) % m;
}
inline long long ksm(long long a, long long x) {
  long long ret = 1;
  while (x) {
    if (x & 1) ret = (ret * a) % mod;
    a = (a * a) % mod;
    x >>= 1;
  }
  return ret;
}
const int MAXN = 2e5 + 10;
const int INF = 0x3f3f3f3f;
int n, m, k;
long long tree[MAXN << 2];
long long treeMIN[MAXN << 2];
long long treeMAX[MAXN << 2];
long long lazy[MAXN << 2];
void push_up(int rt) {
  tree[rt] = tree[rt << 1] + tree[rt << 1 | 1];
  treeMIN[rt] = min(treeMIN[rt << 1], treeMIN[rt << 1 | 1]);
  treeMAX[rt] = max(treeMAX[rt << 1], treeMAX[rt << 1 | 1]);
}
void build(int l, int r, int rt) {
  if (l == r) {
    scanf("%lld", tree + rt);
    treeMIN[rt] = tree[rt];
    treeMAX[rt] = tree[rt];
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
  push_up(rt);
}
void push_down(int l, int r, int rt, int mid) {
  if (lazy[rt]) {
    lazy[rt << 1] = lazy[rt << 1 | 1] = lazy[rt];
    treeMIN[rt << 1] = treeMAX[rt << 1] = treeMIN[rt << 1 | 1] =
        treeMAX[rt << 1 | 1] = lazy[rt];
    tree[rt << 1] = lazy[rt] * (mid - l + 1);
    tree[rt << 1 | 1] = lazy[rt] * (r - mid);
    lazy[rt] = 0;
  }
}
void update(int l, int r, int rt, int L, int R, long long val) {
  if (treeMIN[rt] >= val) return;
  if (L <= l && R >= r) {
    if (treeMAX[rt] <= val) {
      lazy[rt] = val;
      tree[rt] = val * (r - l + 1);
      treeMIN[rt] = treeMAX[rt] = val;
      return;
    }
    treeMIN[rt] = max(treeMIN[rt], val);
    if (l == r) return;
  }
  int mid = (l + r) >> 1;
  push_down(l, r, rt, mid);
  if (L <= mid) update(l, mid, rt << 1, L, R, val);
  if (R > mid) update(mid + 1, r, rt << 1 | 1, L, R, val);
  push_up(rt);
}
int query(int l, int r, int rt, int L, int R, long long &val) {
  if (treeMIN[rt] > val) return 0;
  int mid = (l + r) >> 1;
  if (L <= l && R >= r && tree[rt] <= val) {
    val -= tree[rt];
    return r - l + 1;
  }
  push_down(l, r, rt, mid);
  int ret = 0;
  if (L <= mid && treeMIN[rt << 1] <= val)
    ret += query(l, mid, rt << 1, L, R, val);
  if (R > mid && treeMIN[rt << 1 | 1] <= val)
    ret += query(mid + 1, r, rt << 1 | 1, L, R, val);
  return ret;
}
void solve() {
  int ty, x;
  long long y;
  while (m--) {
    scanf("%d%d%lld", &ty, &x, &y);
    if (ty == 1)
      update(1, n, 1, 1, x, y);
    else
      printf("%d\n", query(1, n, 1, x, n, y));
  }
}
void init() {
  scanf("%d%d", &n, &m);
  build(1, n, 1);
}
int main() {
  int T = 1;
  while (T--) {
    init();
    solve();
  }
  return 0;
}
