#include <bits/stdc++.h>
using namespace std;
long long x[100008];
struct node {
  long long l, r, ls, rs, id, cnt;
  long long w;
};
struct segtree {
  long long cnt;
  node tr[100008 * 40];
  void up(long long rt) {
    tr[rt].w = tr[tr[rt].ls].w + tr[tr[rt].rs].w;
    tr[rt].cnt = tr[tr[rt].ls].cnt + tr[tr[rt].rs].cnt;
    if (tr[tr[rt].ls].cnt)
      tr[rt].id = tr[tr[rt].ls].id;
    else if (tr[tr[rt].rs].cnt)
      tr[rt].id = tr[tr[rt].rs].id;
    else
      tr[rt].id = 0;
  }
  void add(long long a, long long b, long long rt) {
    long long l = tr[rt].l, r = tr[rt].r, m = (l + r) >> 1;
    if (l == r) {
      tr[rt].cnt += b;
      tr[rt].id = (tr[rt].cnt) ? rt : 0;
      tr[rt].w = tr[rt].cnt * a;
      return;
    }
    if (a <= m) {
      if (!tr[rt].ls) {
        tr[rt].ls = ++cnt;
        tr[cnt].l = l;
        tr[cnt].r = m;
      }
      add(a, b, tr[rt].ls);
    } else {
      if (!tr[rt].rs) {
        tr[rt].rs = ++cnt;
        tr[cnt].l = m + 1;
        tr[cnt].r = r;
      }
      add(a, b, tr[rt].rs);
    }
    up(rt);
  }
  double que(long long v, long long cntl, long long wl, long long rt) {
    long long l = tr[rt].l, r = tr[rt].r;
    if (l == r) return 1.0 * (wl + tr[rt].w + v) / (cntl + tr[rt].cnt);
    if (tr[tr[rt].ls].cnt && tr[tr[rt].rs].cnt) {
      if ((wl + tr[tr[rt].ls].w + v) * (tr[tr[tr[rt].rs].id].cnt) <
          (cntl + tr[tr[rt].ls].cnt) * (tr[tr[tr[rt].rs].id].w))
        return que(v, cntl, wl, tr[rt].ls);
      else if ((wl + tr[tr[rt].ls].w + v) * (tr[tr[tr[rt].rs].id].cnt) >
               (cntl + tr[tr[rt].ls].cnt) * (tr[tr[tr[rt].rs].id].w))
        return que(v, cntl + tr[tr[rt].ls].cnt, wl + tr[tr[rt].ls].w,
                   tr[rt].rs);
      else
        return 1.0 * (wl + tr[tr[rt].ls].w + v) / (cntl + tr[tr[rt].ls].cnt);
    } else if (tr[tr[rt].ls].cnt)
      return que(v, cntl, wl, tr[rt].ls);
    else if (tr[tr[rt].rs].cnt)
      return que(v, cntl + tr[tr[rt].ls].cnt, wl + tr[tr[rt].ls].w, tr[rt].rs);
    else
      exit(-1);
  }
} tree;
signed main() {
  long long i, n, q, typ, a, b;
  long long c;
  scanf("%lld %lld", &n, &q);
  ++tree.cnt;
  tree.tr[1].l = 0;
  tree.tr[1].r = 1000000000000000000;
  for (i = 1; i <= n; ++i) {
    scanf("%lld", &x[i]);
    tree.add(x[i], 1, 1);
  }
  while (q--) {
    scanf("%lld", &typ);
    if (typ == 1) {
      scanf("%lld %lld", &a, &b);
      tree.add(x[a], -1, 1);
      x[a] = b;
      tree.add(x[a], 1, 1);
    } else {
      scanf("%lld", &c);
      printf("%.5lf\n", tree.que(c, 0, 0, 1));
    }
  }
  return 0;
}
