#include <bits/stdc++.h>
using namespace std;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
const int maxn = 1000 * 1000 + 10;
const double eps = 0.000000001;
struct Treap {
  int x, y, l, r, cnt, mn;
  long long sum;
};
int fre, root;
Treap t[maxn];
void recalc(int v) {
  t[v].sum = t[t[v].l].sum + t[t[v].r].sum + t[v].x;
  t[v].cnt = t[t[v].l].cnt + t[t[v].r].cnt + 1;
  t[v].mn = min(min(t[t[v].l].mn, t[t[v].r].mn), t[v].x);
  return;
}
pair<int, int> split(int v, int x) {
  if (!v) return make_pair(0, 0);
  if (x < t[v].x) {
    pair<int, int> res = split(t[v].l, x);
    t[v].l = res.second;
    recalc(v);
    res.second = v;
    return res;
  } else {
    pair<int, int> res = split(t[v].r, x);
    t[v].r = res.first;
    recalc(v);
    res.first = v;
    return res;
  }
}
int merg(int t1, int t2) {
  if (!t1) return t2;
  if (!t2) return t1;
  if (t[t1].y > t[t2].y) {
    t[t1].r = merg(t[t1].r, t2);
    recalc(t1);
    return t1;
  } else {
    t[t2].l = merg(t1, t[t2].l);
    recalc(t2);
    return t2;
  }
}
void add(int x) {
  t[++fre].x = x;
  t[fre].y = (rand() << 16) + rand();
  recalc(fre);
  pair<int, int> res = split(root, x);
  root = merg(res.first, merg(fre, res.second));
  return;
}
void sw(int x, int nx) {
  if (x == nx) return;
  if (nx > x) {
    pair<int, int> resl = split(root, x);
    pair<int, int> resr = split(resl.first, x - 1);
    resl = split(resl.second, nx);
    root = merg(resr.first, merg(t[resr.second].l, t[resr.second].r));
    t[resr.second].l = t[resr.second].r = 0;
    t[resr.second].x = nx;
    recalc(resr.second);
    root = merg(root, merg(resl.first, merg(resr.second, resl.second)));
  } else {
    pair<int, int> resl = split(root, x - 1);
    pair<int, int> resr = split(resl.second, x);
    resl = split(resl.first, nx);
    root = merg(merg(t[resr.first].l, t[resr.first].r), resr.second);
    t[resr.first].l = t[resr.first].r = 0;
    t[resr.first].x = nx;
    recalc(resr.first);
    root = merg(merg(resl.first, merg(resr.first, resl.second)), root);
  }
  return;
}
bool check(double x, long long v) {
  pair<int, int> res = split(root, min((long long)x, inf + 0ll));
  if (x * t[res.first].cnt - t[res.first].sum + eps >= v) {
    root = merg(res.first, res.second);
    return true;
  } else {
    root = merg(res.first, res.second);
    return false;
  }
}
int test;
double get(long long v) {
  double L = 0, R = 1000ll * 1000 * 1000 * 1000 * 1000 * 100, mid;
  for (int i = 0; i < 100; ++i) {
    mid = (L + R) / 2;
    if (check(mid, v))
      R = mid;
    else
      L = mid;
  }
  return R;
}
void print(int v, int h) {
  if (!v) return;
  print(t[v].r, h + 2);
  for (int i = 0; i < h; ++i) cout << ' ';
  cout << t[v].x << '\n';
  print(t[v].l, h + 2);
  return;
}
int n, q, a[maxn], pos, x;
long long v;
int main() {
  scanf("%d%d", &n, &q);
  int cur = inf;
  t[0].mn = inf;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    add(a[i]);
  }
  for (int i = 1; i <= q; ++i) {
    scanf("%d", &test);
    if (test == 1) {
      scanf("%d%d", &pos, &x);
      cerr << pos << ' ' << x << '\n';
      sw(a[pos], x);
      a[pos] = x;
    } else {
      scanf("%I64d", &v);
      printf("%.10lf\n", max(t[root].mn + 0.0, get(v)));
    }
  }
  return 0;
}
