#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, M = 1e9;
int sz, n, q, a[N], type, p, x;
long double l, r, mid, v;
struct item {
  int cnt;
  long long sum;
  item *l, *r;
  item() {
    cnt = 0;
    sum = 0;
    l = nullptr;
    r = nullptr;
  }
};
typedef item *node;
node root = new item();
inline int Cnt(node v) { return v ? v->cnt : 0; }
inline long long Sum(node v) { return v ? v->sum : 0; }
inline void update(node v, int l, int r, int pos, int cnt, int val) {
  if (l == r) {
    v->cnt += cnt;
    v->sum += val;
    return;
  }
  int mid = (r + l) >> 1;
  if (pos <= mid) {
    if (!v->l) {
      v->l = new item();
    }
    update(v->l, l, mid, pos, cnt, val);
  } else {
    if (!v->r) {
      v->r = new item();
    }
    update(v->r, mid + 1, r, pos, cnt, val);
  }
  v->cnt = Cnt(v->l) + Cnt(v->r);
  v->sum = Sum(v->l) + Sum(v->r);
}
inline int get_cnt(node v, int l, int r, int tl, int tr) {
  if (!v || l > r || tl > r || l > tr) {
    return 0;
  }
  if (tl <= l && r <= tr) {
    return v->cnt;
  }
  int mid = (r + l) >> 1;
  return get_cnt(v->l, l, mid, tl, tr) + get_cnt(v->r, mid + 1, r, tl, tr);
}
inline long long get_sum(node v, int l, int r, int tl, int tr) {
  if (!v || l > r || tl > r || l > tr) {
    return 0;
  }
  if (tl <= l && r <= tr) {
    return v->sum;
  }
  int mid = (r + l) >> 1;
  return get_sum(v->l, l, mid, tl, tr) + get_sum(v->r, mid + 1, r, tl, tr);
}
inline bool check(long double x, long double v) {
  bool e = (get_cnt(root, 0, sz, 0, min((long long)sz, (long long)x)) * x -
            get_sum(root, 0, sz, 0, min((long long)sz, (long long)x))) <= v;
  return e;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(7);
  sz = 1;
  while (sz < M) {
    sz += sz;
  }
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    update(root, 0, sz, a[i], 1, a[i]);
  }
  while (q--) {
    cin >> type;
    if (type == 1) {
      cin >> p >> x;
      update(root, 0, sz, a[p], -1, -a[p]);
      a[p] = x;
      update(root, 0, sz, x, 1, x);
    } else {
      cin >> v;
      l = 0, r = 1e15;
      for (int i = 1; i <= 150; i++) {
        mid = (r + l) / 2;
        if (check(mid, v)) {
          l = mid;
        } else {
          r = mid;
        }
      }
      cout << l << "\n";
    }
  }
}
