#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 10;
struct Node {
  int mn, tag;
  long long sum;
} tree[maxN * 4 + 1];
int n, m;
int a[maxN + 1];
inline int read() {
  int num = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) num = (num << 3) + (num << 1) + (ch ^ 48), ch = getchar();
  return num * f;
}
inline void pushup(int node) {
  tree[node].sum = tree[node << 1].sum + tree[node << 1 | 1].sum;
  tree[node].mn = min(tree[node << 1].mn, tree[node << 1 | 1].mn);
}
inline void pushdown(int node, int l, int r) {
  if (!tree[node].tag) return;
  int mid = (l + r) >> 1, v = tree[node].tag;
  tree[node << 1].mn = tree[node << 1].tag = v;
  tree[node << 1].sum = 1ll * (mid - l + 1) * v;
  tree[node << 1 | 1].mn = tree[node << 1 | 1].tag = v;
  tree[node << 1 | 1].sum = 1ll * (r - mid) * v;
  tree[node].tag = 0;
}
inline void build(int node, int l, int r) {
  if (l == r) {
    tree[node].mn = tree[node].sum = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(node << 1, l, mid);
  build(node << 1 | 1, mid + 1, r);
  pushup(node);
}
inline int find(int node, int l, int r, int x) {
  if (tree[node].mn >= x) return 0;
  if (l == r) return l;
  pushdown(node, l, r);
  int mid = (l + r) >> 1, t = find(node << 1, l, mid, x);
  return t ? t : find(node << 1 | 1, mid + 1, r, x);
}
inline void modify(int node, int l, int r, int x, int y, int v) {
  if (x <= l && r <= y) {
    tree[node].mn = v;
    tree[node].sum = 1ll * v * (r - l + 1);
    tree[node].tag = v;
    return;
  }
  pushdown(node, l, r);
  int mid = (l + r) >> 1;
  if (x <= mid) modify(node << 1, l, mid, x, y, v);
  if (y > mid) modify(node << 1 | 1, mid + 1, r, x, y, v);
  pushup(node);
}
inline int get1(int node, int l, int r, int x, int v) {
  if (r < x || tree[node].mn > v) return 0;
  if (l == r) return l;
  pushdown(node, l, r);
  int mid = (l + r) >> 1, t = get1(node << 1, l, mid, x, v);
  return t ? t : get1(node << 1 | 1, mid + 1, r, x, v);
}
inline int get2(int node, int l, int r, int x, int &v) {
  if (r < x) return r;
  if (l >= x && v >= tree[node].sum) {
    v -= tree[node].sum;
    return r;
  }
  if (l == r) return l - 1;
  pushdown(node, l, r);
  int mid = (l + r) >> 1, t = get2(node << 1, l, mid, x, v);
  return t < mid ? t : get2(node << 1 | 1, mid + 1, r, x, v);
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  build(1, 1, n);
  while (m--) {
    int op = read(), x = read(), y = read();
    if (op == 1) {
      if (tree[1].mn >= y) continue;
      int p = find(1, 1, n, y);
      if (p <= x) modify(1, 1, n, p, x, y);
    } else {
      int ans = 0;
      while (y) {
        x = get1(1, 1, n, x, y);
        if (!x) break;
        int nx = get2(1, 1, n, x, y);
        ans += nx - x + 1;
        x = nx + 1;
        if (x > n) break;
      }
      printf("%d\n", ans);
    }
  }
  return 0;
}
