#include <bits/stdc++.h>
using namespace std;
const int N = 200003;
int n, q;
unsigned long long a[N];
struct ok {
  int lo;
  int hi;
  unsigned long long val;
  unsigned long long cnt;
  unsigned long long lazy;
  unsigned long long mi;
};
ok Node[4 * N];
void build(int id, int l, int r) {
  Node[id].lo = l;
  Node[id].hi = r;
  if (l == r) {
    Node[id].val = a[l];
    Node[id].cnt = 1;
    Node[id].mi = a[l];
    return;
  }
  int mid = (l + r) / 2;
  build(id * 2, l, mid);
  build(id * 2 + 1, mid + 1, r);
  Node[id].val = Node[id * 2].val + Node[id * 2 + 1].val;
  Node[id].cnt = Node[id * 2].cnt + Node[id * 2 + 1].cnt;
  Node[id].mi = Node[id * 2 + 1].mi;
}
void down(int id) {
  unsigned long long t = Node[id].lazy;
  Node[id * 2].val = max(Node[id * 2].val, t * Node[id * 2].cnt);
  Node[id * 2].lazy = max(Node[id * 2].lazy, t);
  Node[id * 2].mi = max(Node[id * 2].mi, t);
  Node[id * 2 + 1].val = max(Node[id * 2 + 1].val, t * Node[id * 2 + 1].cnt);
  Node[id * 2 + 1].lazy = max(Node[id * 2 + 1].lazy, t);
  Node[id * 2 + 1].mi = max(Node[id * 2 + 1].mi, t);
  Node[id].lazy = 0;
  return;
}
void update(int id, int l, int r, unsigned long long val) {
  if (l > r) return;
  if (Node[id].lo > r || Node[id].hi < l) return;
  if (l <= Node[id].lo && Node[id].hi <= r) {
    Node[id].val = max(Node[id].val, val * Node[id].cnt);
    Node[id].lazy = max(Node[id].lazy, val);
    Node[id].mi = max(Node[id].mi, val);
    return;
  }
  down(id);
  update(id * 2, l, r, val);
  update(id * 2 + 1, l, r, val);
  Node[id].val = Node[id * 2].val + Node[id * 2 + 1].val;
  Node[id].mi = Node[id * 2 + 1].mi;
}
unsigned long long getpos(int id, int pos) {
  if (Node[id].lo > pos || Node[id].hi < pos) return 0;
  if (Node[id].lo == Node[id].hi) return Node[id].val;
  down(id);
  return max(getpos(id * 2, pos), getpos(id * 2 + 1, pos));
}
pair<unsigned long long, unsigned long long> getval(int id, int l, int r,
                                                    unsigned long long sum) {
  if (Node[id].lo > r || Node[id].hi < l) return {0, 0};
  if (Node[id].mi > sum) return {0, 0};
  if (Node[id].val <= sum && Node[id].lo >= l)
    return {Node[id].cnt, Node[id].val};
  down(id);
  if (Node[id * 2].mi <= sum) {
    pair<unsigned long long, unsigned long long> top =
        getval(id * 2, l, r, sum);
    int cnt = top.first;
    unsigned long long val = top.second;
    top = getval(id * 2 + 1, l, r, sum - val);
    return {cnt + top.first, val + top.second};
  } else
    return getval(id * 2 + 1, l, r, sum);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) cin >> a[i];
  build(1, 1, n);
  while (q--) {
    int tp, x;
    unsigned long long y;
    cin >> tp >> x >> y;
    if (tp == 1) {
      int pos = x + 1;
      int lo = 1, hi = x;
      while (lo <= hi) {
        int mid = (lo + hi) / 2;
        unsigned long long cur = getpos(1, mid);
        if (cur >= y) {
          lo = mid + 1;
        } else {
          pos = mid;
          hi = mid - 1;
        }
      }
      update(1, pos, x, y);
    } else {
      cout << getval(1, x, n, y).first << '\n';
    }
  }
}
