#include <bits/stdc++.h>
using namespace std;
const long long INF = 9223372036854775807;
const long long MOD = 1000000007;
const long double PI = acos(-1);
inline long long power(long long a, long long b, long long z = MOD) {
  long long res = 1;
  a = (a % z);
  while (b) {
    if (b & 1) res = (res * a) % z;
    a = (a * a) % z;
    b = b >> 1;
  }
  return res;
}
inline long long inverse(long long a, long long z = MOD) {
  return power(a, z - 2, z);
}
long long extend(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1;
  long long g = extend(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
  return g;
}
inline long long mat_power(long long a, long long b, long long c, long long d,
                           long long n, long long z = MOD) {
  long long a0 = 1, b0 = 0, c0 = 0, d0 = 1;
  while (n) {
    if (n & 1) {
      long long a1 = a0, b1 = b0, c1 = c0, d1 = d0;
      a0 = (a1 * a + b1 * c) % z;
      b0 = (a1 * b + b1 * d) % z;
      c0 = (c1 * a + d1 * c) % z;
      d0 = (c1 * b + d1 * d) % z;
    }
    long long a1 = a, b1 = b, c1 = c, d1 = d;
    a = (a1 * a1 + b1 * c1) % z;
    b = (a1 * b1 + b1 * d1) % z;
    c = (c1 * a1 + d1 * c1) % z;
    d = (c1 * b1 + d1 * d1) % z;
    n = n >> 1;
  }
  return c0;
}
long long aray[200000], sum[800005], low[800005], high[800005], lazy[800005];
void build(long long node, long long l, long long r) {
  lazy[node] = 0;
  if (l == r) {
    sum[node] = low[node] = high[node] = aray[l];
    return;
  }
  long long mid = (l + r) >> 1;
  build(node << 1, l, mid);
  build((node << 1) + 1, mid + 1, r);
  sum[node] = sum[node << 1] + sum[(node << 1) + 1];
  low[node] = min(low[node << 1], low[(node << 1) + 1]);
  high[node] = max(high[node << 1], high[(node << 1) + 1]);
  return;
}
void update(long long node, long long l, long long r, long long left,
            long long right, long long val) {
  if (lazy[node] != 0) {
    sum[node] = lazy[node] * (r - l + 1);
    low[node] = high[node] = lazy[node];
    if (l != r) {
      lazy[node << 1] = max(lazy[node], lazy[node << 1]);
      lazy[(node << 1) + 1] = max(lazy[node], lazy[(node << 1) + 1]);
    }
    lazy[node] = 0;
  }
  if (left > right) return;
  if (left > r || l > right) return;
  if (left <= l && right >= r) {
    if (high[node] <= val) {
      sum[node] = val * (r - l + 1);
      low[node] = high[node] = val;
      if (l != r) {
        long long mid = (l + r) >> 1;
        lazy[node << 1] = max(lazy[node << 1], val);
        lazy[(node << 1) + 1] = max(lazy[(node << 1) + 1], val);
      }
    } else if (low[node] > val)
      return;
    else {
      long long mid = (l + r) >> 1;
      update(node << 1, l, mid, left, min(mid, right), val);
      update((node << 1) + 1, mid + 1, r, max(left, mid + 1), right, val);
      sum[node] = sum[node << 1] + sum[(node << 1) + 1];
      low[node] = min(low[node << 1], low[(node << 1) + 1]);
      high[node] = max(high[node << 1], high[(node << 1) + 1]);
    }
    return;
  }
  long long mid = (l + r) >> 1;
  update(node << 1, l, mid, left, min(mid, right), val);
  update((node << 1) + 1, mid + 1, r, max(left, mid + 1), right, val);
  sum[node] = sum[node << 1] + sum[(node << 1) + 1];
  low[node] = min(low[node << 1], low[(node << 1) + 1]);
  high[node] = max(high[node << 1], high[(node << 1) + 1]);
  return;
}
pair<long long, long long> query(long long node, long long l, long long r,
                                 long long left, long long right,
                                 long long val) {
  if (left > right) return make_pair(0, 0);
  if (left > r || l > right) return make_pair(0, 0);
  if (lazy[node] != 0) {
    sum[node] = lazy[node] * (r - l + 1);
    low[node] = high[node] = lazy[node];
    if (l != r) {
      lazy[node << 1] = max(lazy[node], lazy[node << 1]);
      lazy[(node << 1) + 1] = max(lazy[node], lazy[(node << 1) + 1]);
    }
    lazy[node] = 0;
  }
  if (left <= l && right >= r) {
    if (low[node] > val) return make_pair(0, 0);
    if (sum[node] <= val) return make_pair(r - l + 1, sum[node]);
    long long mid = (l + r) >> 1;
    pair<long long, long long> num =
        query(node << 1, l, mid, left, max(right, mid), val);
    pair<long long, long long> tot =
        query((node << 1) + 1, mid + 1, r, max(left, mid + 1), right,
              val - num.second);
    return make_pair(num.first + tot.first, num.second + tot.second);
  }
  if (low[node] > val) return make_pair(0, 0);
  long long mid = (l + r) >> 1;
  pair<long long, long long> num =
      query(node << 1, l, mid, left, max(right, mid), val);
  pair<long long, long long> tot = query(
      (node << 1) + 1, mid + 1, r, max(left, mid + 1), right, val - num.second);
  return make_pair(num.first + tot.first, num.second + tot.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, q;
  cin >> n >> q;
  for (long long i = 0; i < n; i++) cin >> aray[i];
  build(1, 0, n - 1);
  while (q--) {
    long long t, x, y;
    cin >> t >> x >> y;
    if (t == 1)
      update(1, 0, n - 1, 0, x - 1, y);
    else
      cout << query(1, 0, n - 1, x - 1, n - 1, y).first << "\n";
  }
  return 0;
}
