#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long infLL = 0x3f3f3f3f3f3f3f3fLL;
class SBT {
  struct Node {
    int val, sz;
    long long sum;
    Node *c[2];
    Node(int v, int s, Node *p) : val(v), sz(s), sum(v) { c[0] = c[1] = p; }
    void rz() {
      sz = c[0]->sz + c[1]->sz + 1;
      sum = c[0]->sum + c[1]->sum + val;
    }
  } * root, *null;
  void clear(Node *t) {
    if (t == null) return;
    clear(t->c[0]);
    clear(t->c[1]);
    delete t;
  }
  void rotate(Node *&t, bool d) {
    Node *p = t->c[d];
    t->c[d] = p->c[!d];
    p->c[!d] = t;
    t->rz();
    p->rz();
    t = p;
  }
  void maintain(Node *&t, bool d) {
    if (t == null) return;
    Node *&p = t->c[d];
    if (p->c[d]->sz > t->c[!d]->sz) {
      rotate(t, d);
    } else if (p->c[!d]->sz > t->c[!d]->sz) {
      rotate(p, !d);
      rotate(t, d);
    } else {
      return;
    }
    maintain(t->c[0], 0);
    maintain(t->c[1], 1);
    maintain(t, 0);
    maintain(t, 1);
  }
  void insert(Node *&t, int x) {
    if (t == null) {
      t = new Node(x, 1, null);
      return;
    }
    bool d = x > t->val;
    insert(t->c[d], x);
    maintain(t, d);
    t->rz();
  }
  void erase(Node *&t, int x) {
    if (t == null) return;
    if (t->val == x) {
      if (t->c[1] == null) {
        delete t;
        t = t->c[0];
        return;
      }
      if (t->c[0] == null) {
        delete t;
        t = t->c[1];
        return;
      }
      Node *p = t->c[1];
      while (p->c[0] != null) p = p->c[0];
      t->val = p->val;
      erase(t->c[1], p->val);
      maintain(t, 0);
    } else {
      bool d = x > t->val;
      erase(t->c[d], x);
      maintain(t, !d);
    }
    t->rz();
  }
  int select(Node *t, int k) {
    int r = t->c[0]->sz;
    if (k == r) return t->val;
    if (k < r) return select(t->c[0], k);
    return select(t->c[1], k - r - 1);
  }
  int rank(Node *t, int x) {
    if (t == null) return 0;
    int r = t->c[0]->sz;
    if (x == t->val) return r;
    if (x < t->val) return rank(t->c[0], x);
    return r + 1 + rank(t->c[1], x);
  }

 public:
  SBT() {
    null = new Node(0, 0, 0);
    null->c[0] = null->c[1] = null;
    root = null;
  }
  ~SBT() {
    clear(root);
    delete null;
  }
  void clear() {
    clear(root);
    root = null;
  }
  bool empty() { return root == null; }
  int size() { return root->sz; }
  void insert(int x) { insert(root, x); }
  void erase(int x) { erase(root, x); }
  int select(int k) {
    if (k < 1) return -inf;
    if (k > root->sz) return inf;
    return select(root, k - 1);
  }
  int rank(int x) { return rank(root, x) + 1; }
  double find(Node *u, long long v, int psz, long long psum) {
    if ((long long)u->val * (psz + u->c[0]->sz) >= psum + u->c[0]->sum + v) {
      if (u->c[0] != null) {
        double t = find(u->c[0], v, psz, psum);
        if (t > -1) return t;
      }
      return ((double)v + psum + u->c[0]->sum) / (psz + u->c[0]->sz);
    }
    if (u->c[1] == null) return -1;
    return find(u->c[1], v, psz + u->c[0]->sz + 1,
                psum + u->c[0]->sum + u->val);
  }
  double solve(long long v) {
    double res = find(root, v, 0, 0);
    if (res < 0)
      return ((double)v + root->sum) / root->sz;
    else
      return res;
  }
} tree;
const int maxn = 100000 + 5;
int n, q;
int h[maxn];
int main() {
  cin >> n >> q;
  for (int i = 0; i < (n); ++i) {
    cin >> h[i];
    tree.insert(h[i]);
  }
  while (q--) {
    int op, p, x;
    long long v;
    cin >> op;
    if (op == 1) {
      cin >> p >> x;
      --p;
      tree.erase(h[p]);
      tree.insert(h[p] = x);
    } else {
      cin >> v;
      cout << fixed << setprecision(5) << tree.solve(v) << endl;
    }
  }
  return 0;
}
