#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[200200];
int t[550000], tq[550000];
long long ts[550000];
int s[550000], e[550000], p = 1 << 18;
int fq(int x, int v) {
  if (x >= p) return s[x];
  if (t[x]) return e[x];
  if (tq[2 * x + 1] >= v) return fq(2 * x + 1, v);
  return fq(2 * x, v);
}
void fqq(int x, int l, int r, int v) {
  if (t[x] && x < p) {
    t[2 * x] = t[2 * x + 1] = t[x];
    tq[2 * x] = tq[2 * x + 1] = t[x];
    ts[2 * x] = ts[2 * x + 1] = t[x] * (e[2 * x] - s[2 * x] + 1ll);
    t[x] = 0;
  }
  if (s[x] == l && e[x] == r) {
    t[x] = max(t[x], v);
    tq[x] = max(tq[x], v);
    return;
  } else if (l >= s[2 * x + 1])
    fqq(2 * x + 1, l, r, v);
  else if (r <= e[2 * x])
    fqq(2 * x, l, r, v);
  else {
    fqq(2 * x, l, e[2 * x], v);
    fqq(2 * x + 1, s[2 * x + 1], r, v);
  }
  tq[x] = max(tq[2 * x], tq[2 * x + 1]);
}
void fv(int x, int l, int r, long long v) {
  if (t[x] && x < p) {
    t[2 * x] = t[2 * x + 1] = t[x];
    ts[2 * x] = ts[2 * x + 1] = t[x] * (e[2 * x] - s[2 * x] + 1ll);
    tq[2 * x] = tq[2 * x + 1] = t[x];
  }
  t[x] = 0;
  if (l == s[x] && r == e[x]) {
    t[x] = v;
    ts[x] = v * (e[x] - s[x] + 1);
    return;
  } else if (l >= s[2 * x + 1])
    fv(2 * x + 1, l, r, v);
  else if (r <= e[2 * x])
    fv(2 * x, l, r, v);
  else
    fv(2 * x, l, e[2 * x], v), fv(2 * x + 1, s[2 * x + 1], r, v);
  ts[x] = ts[2 * x] + ts[2 * x + 1];
}
int fl(int x, int v) {
  if (x >= p)
    return s[x];
  else if (t[x])
    return e[x];
  else if (tq[2 * x + 1] > v)
    return fl(2 * x + 1, v);
  else
    return fl(2 * x, v);
}
long long fs(int x, int l, int r) {
  if (l == s[x] && r == e[x])
    return ts[x];
  else if (t[x])
    return t[x] * (r - l + 1ll);
  else if (l >= s[2 * x + 1])
    return fs(2 * x + 1, l, r);
  else if (r <= e[2 * x])
    return fs(2 * x, l, r);
  else
    return fs(2 * x, l, e[2 * x]) + fs(2 * x + 1, s[2 * x + 1], r);
}
pair<int, long long> fr(int x, int l, long long v) {
  if (l == s[x]) {
    if (v >= ts[x])
      return {e[x] + 1, v - ts[x]};
    else if (x >= p)
      return {e[x], v};
    else if (t[x])
      return {l + v / t[x], v % t[x]};
    else if (ts[2 * x] <= v)
      return fr(2 * x + 1, s[2 * x + 1], v - ts[2 * x]);
    else
      return fr(2 * x, l, v);
  } else if (t[x]) {
    int c = v / t[x];
    c = min(c, e[x] - l + 1);
    return {l + c, v - t[x] * c};
  } else if (l >= s[2 * x + 1])
    return fr(2 * x + 1, l, v);
  else {
    pair<int, long long> pr = fr(2 * x, l, v);
    if (pr.first == s[2 * x + 1])
      return fr(2 * x + 1, s[2 * x + 1], pr.second);
    else
      return pr;
  }
}
int main(void) {
  for (int i = 0; i < p; i++) s[i + p] = e[i + p] = i;
  for (int i = p - 1; i; i--) {
    s[i] = s[2 * i];
    e[i] = e[2 * i + 1];
  }
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    ts[i + p] = a[i];
    tq[i + p] = a[i];
  }
  for (int i = p - 1; i; i--) {
    ts[i] = ts[2 * i] + ts[2 * i + 1];
    tq[i] = max(tq[2 * i], tq[2 * i + 1]);
  }
  while (q--) {
    int t, x, y;
    scanf("%d %d %d", &t, &x, &y);
    x--;
    if (t == 1) {
      int l = 0;
      if (tq[1] >= y) l = max(l, fq(1, y) + 1);
      if (l > x) continue;
      fqq(1, l, x, y);
      fv(1, l, x, y);
    } else {
      int c = 0;
      while (1) {
        int l = 0;
        if (tq[1] > y) l = fl(1, y) + 1;
        l = max(x, l);
        if (l >= n) break;
        pair<int, long long> pr = fr(1, l, y);
        x = pr.first;
        x = min(x, n);
        c += x - l;
        y = pr.second;
      }
      printf("%d\n", c);
    }
  }
}
