#include <bits/stdc++.h>
using namespace std;
int n, q, op;
long long x, y;
long long bit1[300010];
long long bit2[300010];
vector<long long> v, tmp;
vector<pair<long long, long long> > que;
map<long long, int> m;
void update(int idx, long long val, long long bit[300010]) {
  while (idx < 300010) {
    bit[idx] += val;
    idx += (idx & -idx);
  }
}
long long query(int idx, long long bit[300010]) {
  long long ret = 0;
  while (idx > 0) {
    ret += bit[idx];
    idx -= (idx & -idx);
  }
  return ret;
}
double bs(double lo, double hi, double zn) {
  while (hi - lo > 1e-5) {
    double mid = (hi + lo) / 2;
    long long val = (long long)mid;
    int id;
    if (m.find(val) != m.end()) {
      id = m[val];
    } else {
      map<long long, int>::iterator it = m.upper_bound(val);
      if (it == m.begin()) {
        lo = mid;
        id = -1;
      } else if (it == m.end()) {
        map<long long, int>::reverse_iterator rit = m.rbegin();
        id = rit->second;
      } else {
        map<long long, int>::reverse_iterator rit(it);
        id = rit->second;
      }
    }
    if (id != -1) {
      double n = query(id, bit1);
      double Sn = query(id, bit2);
      if (n >= zn / mid + Sn / mid) {
        hi = mid;
      } else
        lo = mid;
    }
  }
  return lo;
}
int main(void) {
  ios ::sync_with_stdio(false);
  cin >> n >> q;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    v.push_back(x);
  }
  for (int i = 0; i < q; ++i) {
    cin >> op;
    if (op == 1) {
      cin >> x >> y;
      que.push_back(make_pair(x, y));
    } else {
      cin >> x;
      que.push_back(make_pair(-1, x));
    }
  }
  for (int i = 0; i < v.size(); ++i) {
    tmp.push_back(v[i]);
  }
  for (int i = 0; i < que.size(); ++i) {
    if (que[i].first != -1) {
      tmp.push_back(que[i].second);
    }
  }
  sort(tmp.begin(), tmp.end());
  int cont = 1;
  for (int i = 0; i < tmp.size(); ++i) {
    if (!m[tmp[i]]) m[tmp[i]] = cont++;
  }
  for (int i = 0; i < v.size(); ++i) {
    update(m[v[i]], 1, bit1);
    update(m[v[i]], v[i], bit2);
  }
  for (int i = 0; i < que.size(); ++i) {
    if (que[i].first != -1) {
      que[i].first--;
      long long val = v[que[i].first];
      update(m[val], -1, bit1);
      update(m[val], -val, bit2);
      v[que[i].first] = que[i].second;
      update(m[que[i].second], 1, bit1);
      update(m[que[i].second], que[i].second, bit2);
    } else {
      cout << setprecision(5) << fixed
           << bs(0, (double)1000000000000000LL, (double)que[i].second) << "\n";
    }
  }
  return 0;
}
