#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
struct Node {
  int rnd;
  int lch, rch;
  long long val, siz, sum, rep;
  void clear() {
    lch = rch = -1;
    rnd = rand();
    val = siz = sum = rep = 0;
  }
} treap[MAXN];
int tot, root;
void init() {
  root = -1;
  tot = 0;
}
int alloc() {
  tot++;
  treap[tot].clear();
  return tot;
}
void maintain(int k) {
  long long siz = treap[k].rep;
  if (treap[k].lch != -1) siz += treap[treap[k].lch].siz;
  if (treap[k].rch != -1) siz += treap[treap[k].rch].siz;
  treap[k].siz = siz;
  long long sum = treap[k].val * treap[k].rep;
  if (treap[k].lch != -1) sum += treap[treap[k].lch].sum;
  if (treap[k].rch != -1) sum += treap[treap[k].rch].sum;
  treap[k].sum = sum;
}
void rturn(int &k) {
  int t = treap[k].lch;
  treap[k].lch = treap[t].rch;
  treap[t].rch = k;
  maintain(k);
  maintain(t);
  k = t;
}
void lturn(int &k) {
  int t = treap[k].rch;
  treap[k].rch = treap[t].lch;
  treap[t].lch = k;
  maintain(k);
  maintain(t);
  k = t;
}
void insert(int &k, long long x) {
  if (k == -1) {
    k = alloc();
    treap[k].siz = treap[k].rep = 1;
    treap[k].val = treap[k].sum = x;
    return;
  }
  treap[k].siz++;
  treap[k].sum += x;
  if (treap[k].val == x)
    treap[k].rep++;
  else if (x > treap[k].val) {
    insert(treap[k].rch, x);
    if (treap[treap[k].rch].rnd < treap[k].rnd) {
      lturn(k);
    }
  } else {
    insert(treap[k].lch, x);
    if (treap[treap[k].lch].rnd < treap[k].rnd) {
      rturn(k);
    }
  }
}
void remove(int &k, long long x) {
  if (k == -1) return;
  if (treap[k].val == x) {
    if (treap[k].rep > 1) {
      treap[k].rep--;
      treap[k].siz--;
      treap[k].sum -= x;
      return;
    }
    if (treap[k].lch == -1 || treap[k].rch == -1) {
      k = (treap[k].lch == -1) ? treap[k].rch : treap[k].lch;
    } else if (treap[treap[k].lch].rnd < treap[treap[k].rch].rnd) {
      rturn(k);
      remove(k, x);
    } else {
      lturn(k);
      remove(k, x);
    }
  } else if (x > treap[k].val) {
    treap[k].siz--;
    treap[k].sum -= x;
    remove(treap[k].rch, x);
  } else {
    treap[k].siz--;
    treap[k].sum -= x;
    remove(treap[k].lch, x);
  }
}
long long count(int k, long long x) {
  if (k == -1) return 0;
  if (treap[k].val == x) return treap[k].rep;
  if (x > treap[k].val) {
    return count(treap[k].rch, x);
  } else {
    return count(treap[k].lch, x);
  }
}
double query_sum(int k, double x) {
  if (k == -1) return 0;
  double ret = 0;
  if (x < treap[k].val) {
    ret += query_sum(treap[k].lch, x);
    return ret;
  } else {
    if (treap[k].lch != -1) ret += treap[treap[k].lch].sum;
    ret += (double)treap[k].val * treap[k].rep;
    ret += query_sum(treap[k].rch, x);
    return ret;
  }
}
double query_siz(int k, double x) {
  if (k == -1) return 0;
  double ret = 0;
  if (x < treap[k].val) {
    ret += query_siz(treap[k].lch, x);
    return ret;
  } else {
    if (treap[k].lch != -1) ret += treap[treap[k].lch].siz;
    ret += (double)treap[k].rep;
    ret += query_siz(treap[k].rch, x);
    return ret;
  }
}
long long N, Q;
long long seq[MAXN];
bool check(double mid, double arg) {
  double require = query_siz(root, mid) * mid - query_sum(root, mid);
  return arg < require;
}
double solve(double arg) {
  double l = 0, r = 1e17, mid;
  for (int i = 0; i < 100; i++) {
    mid = (l + r) / 2.0;
    if (check(mid, arg)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  return l;
}
int main(int argc, const char *argv[]) {
  srand(time(NULL));
  while (cin >> N >> Q) {
    init();
    for (int i = 1; i <= N; i++) {
      cin >> seq[i];
      insert(root, seq[i]);
    }
    for (int i = 1; i <= Q; i++) {
      long long typ, arg1, arg2;
      cin >> typ >> arg1;
      if (typ == 1) {
        cin >> arg2;
        remove(root, seq[arg1]);
        seq[arg1] = arg2;
        insert(root, arg2);
      } else {
        cout << fixed << setprecision(10) << solve(arg1) << endl;
      }
    }
  }
  return 0;
}
