#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
const int mod = 1e9 + 7;
const int inf = 1e8;
int ls[maxn * 40], rs[maxn * 40], num[maxn * 40];
long long sum[maxn * 40];
int rt, a[maxn], tot;
long long z;
void change(int &k, int l, int r, int pos, int val) {
  if (!k) k = ++tot;
  if (l == r) {
    num[k] += val;
    sum[k] += pos * val;
    return;
  }
  int mid = l + r >> 1;
  if (pos <= mid)
    change(ls[k], l, mid, pos, val);
  else
    change(rs[k], mid + 1, r, pos, val);
  sum[k] = sum[ls[k]] + sum[rs[k]];
  num[k] = num[ls[k]] + num[rs[k]];
}
double query(int k, int l, int r, long long Num, long long Sum) {
  if (!k || l == r) return (double)(z + Sum + sum[k]) / (Num + num[k]);
  int mid = l + r >> 1;
  if ((long long)(mid + 1) * (Num + num[ls[k]]) - (Sum + sum[ls[k]]) >= z)
    return query(ls[k], l, mid, Num, Sum);
  else
    return query(rs[k], mid + 1, r, Num + num[ls[k]], Sum + sum[ls[k]]);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    change(rt, 0, 1e9, a[i], 1);
  }
  while (m--) {
    int op, x, y;
    scanf("%d", &op);
    if (op == 1) {
      scanf("%d%d", &x, &y);
      change(rt, 0, 1e9, a[x], -1);
      a[x] = y;
      change(rt, 0, 1e9, a[x], 1);
    } else {
      scanf("%lld", &z);
      printf("%.5f\n", query(rt, 0, 1e9, 0, 0));
    }
  }
  return 0;
}
