#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 * 8 + 100;
const long long o = 100 * 1000;
const long double oo = o * o * o + 1;
const long double eps = 1e-7;
long long n, q, tube[maxn], cnt[maxn], sum[maxn];
vector<long long> query[maxn];
vector<long long> val;
vector<long double> ans;
void add(int ind, long long vl, int x, int segl, int segr);
long double bin(long double f, long double e, long double x);
bool chk(long double md, long double x);
long long getnum(int ql, int qr, int x, int segl, int segr);
long long getsum(int ql, int qr, int x, int segl, int segr);
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> tube[i];
    val.push_back(tube[i]);
  }
  for (int i = 0; i < q; i++) {
    int t;
    cin >> t;
    long long x, y;
    if (t == 1) {
      cin >> x >> y;
      x--;
      query[i].push_back(t);
      query[i].push_back(x);
      query[i].push_back(y);
      val.push_back(y);
    } else {
      cin >> x;
      query[i].push_back(t);
      query[i].push_back(x);
    }
  }
  sort(val.begin(), val.end());
  val.resize(unique(val.begin(), val.end()) - val.begin());
  for (int i = 0; i < n; i++)
    tube[i] = lower_bound(val.begin(), val.end(), tube[i]) - val.begin();
  for (int i = 0; i < q; i++)
    if (query[i].size() > 2)
      query[i][query[i].size() - 1] =
          lower_bound(val.begin(), val.end(), query[i][query[i].size() - 1]) -
          val.begin();
  for (int i = 0; i < n; i++) add(tube[i], 1, 1, 0, val.size() + 1);
  for (int i = 0; i < q; i++) {
    int t = query[i][0];
    if (t == 1) {
      cerr << sum[1] << endl;
      int x = query[i][1], y = query[i][2];
      add(tube[x], -1, 1, 0, val.size() + 1);
      tube[x] = y;
      add(tube[x], 1, 1, 0, val.size() + 1);
      cerr << sum[1] << endl;
    } else {
      long double x = query[i][1];
      ans.push_back(bin(0, oo, x));
    }
  }
  for (int i = 0; i < ans.size(); i++)
    cout << setprecision(4) << fixed << ans[i] << '\n';
  return 0;
}
void add(int ind, long long vl, int x, int segl, int segr) {
  if (segr - segl < 2) {
    cnt[x] += vl;
    sum[x] += vl * val[ind];
    return;
  }
  int mid = (segl + segr) / 2;
  if (ind < mid)
    add(ind, vl, 2 * x, segl, mid);
  else
    add(ind, vl, 2 * x + 1, mid, segr);
  cnt[x] = cnt[2 * x] + cnt[2 * x + 1];
  sum[x] = sum[2 * x] + sum[2 * x + 1];
}
long double bin(long double f, long double e, long double x) {
  for (int i = 0; i < 250; i++) {
    long double mid = (f + e) / 2;
    if (chk(mid, x))
      e = mid;
    else
      f = mid;
  }
  return e;
}
bool chk(long double md, long double x) {
  long long md2 = md;
  md2 = lower_bound(val.begin(), val.end(), md2) - val.begin();
  long double res = getsum(0, md2, 1, 0, val.size() + 1);
  long double rt = getnum(0, md2, 1, 0, val.size() + 1);
  res = rt * md - res;
  if (x < res + eps) return true;
  return false;
}
long long getnum(int ql, int qr, int x, int segl, int segr) {
  if (ql <= segl && qr >= segr - 1) return cnt[x];
  long long res = 0, mid = (segl + segr) / 2;
  if (ql < mid) res += getnum(ql, qr, 2 * x, segl, mid);
  if (qr >= mid) res += getnum(ql, qr, 2 * x + 1, mid, segr);
  return res;
}
long long getsum(int ql, int qr, int x, int segl, int segr) {
  if (ql <= segl && qr >= segr - 1) return sum[x];
  long long res = 0, mid = (segl + segr) / 2;
  if (ql < mid) res += getsum(ql, qr, 2 * x, segl, mid);
  if (qr >= mid) res += getsum(ql, qr, 2 * x + 1, mid, segr);
  return res;
}
