#include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
const double ip = 0.00001;
long long n, q, b[N], len, p[N];
double c[N], d[N], ta;
struct node {
  long long x, z;
  double y;
} a[N];
inline void add(long long w, long long v, long long t) {
  for (; w <= len; w += (w & -w)) c[w] += v, d[w] += t;
}
inline pair<double, double> query(long long w) {
  if (w <= 0) return make_pair(0, 0);
  double re = 0, an = 0;
  for (; w >= 1; w -= (w & -w)) re += c[w], an += d[w];
  return make_pair(re, an);
}
inline bool check(double x) {
  auto tmp =
      query(upper_bound(b + 1, b + len + 1, (long long)(floor(x))) - b - 1);
  return tmp.second * x - tmp.first >= ta;
}
signed main() {
  cin >> n >> q;
  for (long long i = (1), iend = (n); i <= iend; i++)
    cin >> p[i], b[++len] = p[i];
  for (long long i = (1), iend = (q); i <= iend; i++) {
    cin >> a[i].x >> a[i].y;
    if (a[i].x == 1) cin >> a[i].z, b[++len] = a[i].z;
  }
  sort(b + 1, b + len + 1), len = unique(b + 1, b + len + 1) - b - 1;
  for (long long i = (1), iend = (n); i <= iend; i++)
    add(lower_bound(b + 1, b + len + 1, p[i]) - b, p[i], 1);
  for (long long i = (1), iend = (q); i <= iend; i++) {
    if (a[i].x == 1)
      add(lower_bound(b + 1, b + len + 1, p[(long long)(a[i].y)]) - b,
          -p[(long long)(a[i].y)], -1),
          add(lower_bound(b + 1, b + len + 1, p[(long long)(a[i].y)] = a[i].z) -
                  b,
              a[i].z, 1);
    if (a[i].x == 2) {
      ta = a[i].y;
      double l = 0, r = 1e14, ans = r;
      while (r - l > ip) {
        double mid = (r - l) / 2 + l;
        if (check(mid))
          ans = mid, r = mid;
        else
          l = mid;
      }
      printf("%.8lf\n", ans);
    }
  }
  return 0;
}
