#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
inline int getBit(int x, int pos) { return ((x >> pos) & 1); }
const double eps = 1e-9;
const double pi = acos(-1.0);
struct Node {
  long long val, sum;
  int x;
  long long y;
  Node *l, *r;
  Node(long long val, long long y, Node *l = NULL, Node *r = NULL) {
    this->x = 1;
    this->sum = val;
    this->val = val;
    this->y = y;
    this->l = l;
    this->r = r;
  }
};
typedef Node *treap;
inline int getX(treap t) { return (t == NULL ? 0 : t->x); }
inline long long getSum(treap t) { return (t == NULL ? 0 : t->sum); }
void update(treap &t) {
  if (t != NULL) {
    t->x = getX(t->l) + getX(t->r) + 1;
    t->sum = getSum(t->l) + getSum(t->r) + t->val;
  }
}
treap merge(treap l, treap r) {
  if (l == NULL || r == NULL) {
    return (l == NULL ? r : l);
  }
  if (l->y > r->y) {
    l->r = merge(l->r, r);
    update(l);
    return l;
  } else {
    r->l = merge(l, r->l);
    update(r);
    return r;
  }
}
void splitPos(treap t, treap &l, treap &r, int pos) {
  if (t == NULL) {
    l = NULL;
    r = NULL;
    return;
  }
  if (getX(t->l) + 1 > pos) {
    treap tmp = NULL;
    splitPos(t->l, l, tmp, pos);
    t->l = tmp;
    r = t;
    update(r);
  } else {
    treap tmp = NULL;
    splitPos(t->r, tmp, r, pos - getX(t->l) - 1);
    t->r = tmp;
    l = t;
    update(l);
  }
}
void splitVal(treap t, treap &l, treap &r, long long val) {
  if (t == NULL) {
    l = NULL;
    r = NULL;
    return;
  }
  if (t->val > val) {
    treap tmp = NULL;
    splitVal(t->l, l, tmp, val);
    t->l = tmp;
    r = t;
    update(r);
  } else {
    treap tmp = NULL;
    splitVal(t->r, tmp, r, val);
    t->r = tmp;
    l = t;
    update(l);
  }
}
void add(treap &t, long long val) {
  treap l = NULL, r = NULL;
  splitVal(t, l, r, val);
  treap tmp = new Node(val, rand() * 1LL * rand());
  update(tmp);
  t = merge(merge(l, tmp), r);
}
void erase(treap &t, long long val) {
  treap l = NULL, r = NULL, m = NULL, tmp = NULL;
  splitVal(t, l, r, val);
  splitPos(l, m, tmp, getX(l) - 1);
  tmp = NULL;
  t = merge(m, r);
}
pair<int, long long> getCount(treap &t, long long val) {
  treap l = NULL, r = NULL;
  splitVal(t, l, r, val);
  pair<int, long long> res;
  res.first = getX(l);
  res.second = getSum(l);
  t = merge(l, r);
  return res;
}
int n, q;
int a[(int)(1e5) + 10];
int tp;
int p, x;
long long v;
int main() {
  srand(time(0));
  scanf("%d%d", &n, &q);
  treap t = NULL;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    add(t, a[i]);
  }
  while (q-- > 0) {
    scanf("%d", &tp);
    if (tp == 1) {
      scanf("%d%d", &p, &x);
      --p;
      erase(t, a[p]);
      a[p] = x;
      add(t, a[p]);
    } else {
      scanf("%I64d", &v);
      double lf = 0.0, rg = v + (long long)(1e9);
      double md = 0.0;
      for (int it = 0; it < 60; it++) {
        md = (lf + rg) * 0.5;
        pair<int, long long> tmp = getCount(t, md);
        if (tmp.first * 1LL * md - tmp.second >= v)
          rg = md;
        else
          lf = md;
      }
      printf("%.5lf\n", rg);
    }
  }
  return 0;
}
