#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long N = 2e5 + 100;
long long t[4 * N], mn[4 * N], assign[4 * N], a[N];
long long n, q;
void push(long long v, long long l, long long r) {
  if (assign[v]) {
    t[v] = assign[v] * (r - l);
    mn[v] = assign[v];
    if (l + 1 != r) {
      assign[v * 2 + 1] = max(assign[v * 2 + 1], assign[v]);
      assign[v * 2 + 2] = max(assign[v * 2 + 2], assign[v]);
    }
    assign[v] = 0;
  }
}
void build(long long v, long long l, long long r) {
  if (l + 1 == r) {
    t[v] = mn[v] = a[l];
    return;
  }
  long long m = (l + r) / 2;
  build(v * 2 + 1, l, m);
  build(v * 2 + 2, m, r);
  t[v] = t[v * 2 + 1] + t[v * 2 + 2];
  mn[v] = min(mn[v * 2 + 1], mn[v * 2 + 2]);
}
void upd(long long v, long long l, long long r, long long ql, long long qr,
         long long x) {
  push(v, l, r);
  if (qr <= l || r <= ql) {
    return;
  }
  if (ql <= l && r <= qr) {
    assign[v] = max(assign[v], x);
    push(v, l, r);
    return;
  }
  long long m = (l + r) / 2;
  upd(v * 2 + 1, l, m, ql, qr, x);
  upd(v * 2 + 2, m, r, ql, qr, x);
  t[v] = t[v * 2 + 1] + t[v * 2 + 2];
  mn[v] = min(mn[v * 2 + 1], mn[v * 2 + 2]);
}
long long sum(long long v, long long l, long long r, long long ql,
              long long qr) {
  push(v, l, r);
  if (qr <= l || r <= ql) {
    return 0;
  }
  if (ql <= l && r <= qr) {
    return t[v];
  }
  long long m = (l + r) / 2;
  return sum(v * 2 + 1, l, m, ql, qr) + sum(v * 2 + 2, m, r, ql, qr);
}
long long get(long long v, long long l, long long r, long long x) {
  push(v, l, r);
  if (l + 1 == r) {
    return l + (t[v] <= x);
  }
  long long m = (l + r) / 2;
  push(v * 2 + 1, l, m);
  if (t[v * 2 + 1] >= x) {
    return get(v * 2 + 1, l, m, x);
  } else {
    return get(v * 2 + 2, m, r, x - t[v * 2 + 1]);
  }
}
long long find(long long v, long long l, long long r, long long x) {
  push(v, l, r);
  if (mn[v] > x) {
    return n;
  }
  if (l + 1 == r) {
    return l;
  }
  long long m = (l + r) / 2;
  push(v * 2 + 1, l, m);
  if (mn[v * 2 + 1] <= x) {
    return find(v * 2 + 1, l, m, x);
  } else {
    return find(v * 2 + 2, m, r, x);
  }
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> q;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  build(0, 0, n);
  auto getSum = [&](long long l, long long r) {
    r = min(r, n);
    return sum(0, 0, n, l, r);
  };
  auto go = [&](long long x, long long y) {
    long long ret = 0;
    while (x < n) {
      long long to = get(0, 0, n, y + getSum(0, x));
      y -= getSum(x, to);
      ret += to - x;
      x = to;
      if (x == n) break;
      x = find(0, 0, n, y);
    }
    return ret;
  };
  while (q--) {
    long long type, x, y;
    cin >> type >> x >> y;
    x--;
    if (type == 1) {
      long long l = find(0, 0, n, y);
      long long r = x + 1;
      if (r > l) upd(0, 0, n, l, r, y);
    } else {
      cout << go(x, y) << '\n';
    }
  }
}
