#include <bits/stdc++.h>
using namespace std;
int getint() {
  int s = 0, o = 1;
  char c;
  for (c = getchar(); c < '0' || c > '9'; c = getchar())
    if (c == '-') o = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) s *= 10, s += c - '0';
  return s * o;
}
const int maxn = 100010 * 2;
struct node {
  node *f, *c[2];
  int x, s, mx;
  long long xx;
  bool d() { return f->c[1] == this; }
  void up() {
    s = c[0]->s + c[1]->s + 1;
    xx = c[0]->xx + c[1]->xx + x;
    mx = max(x, c[1]->mx);
  }
  void put(node *p, bool o) { c[o] = p, p->f = this; }
  void rot() {
    bool o = d();
    node *F = f;
    F->f->put(this, f->d());
    F->put(c[!o], o);
    put(F, !o);
    F->up(), up();
  }
  void splay(node *);
  void ts();
} mem[maxn], *null = &mem[0], *C = &mem[1];
void node::ts() {
  if (this != null) {
    c[0]->ts();
    printf("X %d S %d XX %I64d\n", x, s, xx);
    c[1]->ts();
  }
}
void node::splay(node *goal = null) {
  while (f != goal) {
    if (f->f == goal)
      rot();
    else {
      (d() == f->d()) ? (f->rot(), rot()) : (rot(), rot());
    }
  }
}
node *newnode(int _x) {
  C->x = _x, C->c[0] = C->c[1] = C->f = null, C->s = 1;
  return C++;
}
node *root = null;
node *ins(node *r, int x) {
  node *p = newnode(x);
  if (r == null) return p;
  for (; r;) {
    int o = x > r->x;
    if (r->c[o] == null) {
      r->put(p, o);
      break;
    } else
      r = r->c[o];
  }
  p->splay(null);
  return p;
}
node *del(node *r, int x) {
  node *p = r, *q;
  for (; p->x != x;) p = p->c[x > p->x];
  p->splay(null);
  q = p->c[0];
  if (q == null) {
    q = p->c[1];
    q->f = null;
    return q;
  }
  for (; q->c[1] != null; q = q->c[1])
    ;
  q->splay(p);
  q->put(p->c[1], 1);
  q->f = null;
  q->up();
  return q;
}
int n, m, x, y;
int a[maxn];
int main(int argc, char const *argv[]) {
  n = getint(), m = getint();
  for (int i = 0; i < n; i++) {
    a[i] = getint();
    root = ins(root, a[i]);
  }
  for (int mm = 0; mm < m; mm++) {
    int o = getint();
    if (o == 1) {
      x = getint(), y = getint();
      x--;
      root = del(root, a[x]);
      root = ins(root, a[x] = y);
    } else {
      long long v;
      scanf("%I64d", &v);
      long long xx = 0, s = 0;
      double r = 1e18, rr;
      node *tmp;
      int nn = n;
      for (node *p = root; p != null;) {
        tmp = p;
        rr = (v + p->c[0]->xx + xx + p->x) * 1.0 / (s + p->c[0]->s + 1);
        if (rr >= p->x) {
          r = min(r, rr);
          xx = p->c[0]->xx + xx + p->x;
          s = s + p->c[0]->s + 1;
          p = p->c[1];
        } else {
          p = p->c[0];
        }
      }
      if (tmp != null) {
        tmp->splay(null);
        root = tmp;
      }
      printf("%.10lf\n", r);
    }
  }
  return 0;
}
