#include <bits/stdc++.h>
using namespace std;
int sz = 1, n, m, a[220001], tt, x, y;
long long v;
unordered_map<int, long long> f[2];
long long sum(bool v, long long r) {
  long long res = 0;
  while (r >= 0) {
    res += f[v][r];
    r = (r & (r + 1)) - 1;
  }
  return res;
}
void update(bool v, long long r, long long val) {
  while (r <= (long long)1e9) f[v][r] += val, r |= r + 1;
}
long long get(bool v, long long l, long long r) {
  return sum(v, r) - sum(v, l - 1);
}
bool check(double x) {
  long long nx = (long long)(x);
  if ((long long)(nx) != x) nx++;
  nx = min(nx, (long long)1e9);
  long long ls = get(0, 0, nx - 1);
  long long mr = get(1, 0, nx - 1);
  return ls * x - mr >= v;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    update(0, a[i], 1);
    update(1, a[i], a[i]);
  }
  while (m--) {
    scanf("%d", &tt);
    if (tt == 1) {
      scanf("%d%d", &x, &y);
      update(0, a[x], -1);
      update(1, a[x], -a[x]);
      a[x] = y;
      update(0, a[x], 1);
      update(1, a[x], a[x]);
    } else {
      scanf("%I64d", &v);
      double l = 0, r = v + 1e9;
      for (int it = 0; it < 45; ++it) {
        double m = (l + r) * 0.5;
        if (check(m))
          r = m;
        else
          l = m;
      }
      printf("%.7f\n", r);
    }
  }
}
