Problem: One day two students, Grisha and Diana, found themselves in the university chemistry lab. In the lab the students found n test tubes with mercury numbered from 1 to n and decided to conduct an experiment.

The experiment consists of q steps. On each step, one of the following actions occurs:

  1. Diana pours all the contents from tube number pi and then pours there exactly xi liters of mercury. 
  2. Let's consider all the ways to add vi liters of water into the tubes; for each way let's count the volume of liquid (water and mercury) in the tube with water with maximum amount of liquid; finally let's find the minimum among counted maximums. That is the number the students want to count. At that, the students don't actually pour the mercury. They perform calculations without changing the contents of the tubes. 



Unfortunately, the calculations proved to be too complex and the students asked you to help them. Help them conduct the described experiment.

Input

The first line contains two integers n and q (1 ≤ n, q ≤ 105) — the number of tubes ans the number of experiment steps. The next line contains n space-separated integers: h1, h2, ..., hn (0 ≤ hi ≤ 109), where hi is the volume of mercury in the і-th tube at the beginning of the experiment.

The next q lines contain the game actions in the following format:

  * A line of form "1 pi xi" means an action of the first type (1 ≤ pi ≤ n; 0 ≤ xi ≤ 109). 
  * A line of form "2 vi" means an action of the second type (1 ≤ vi ≤ 1015). 



It is guaranteed that there is at least one action of the second type. It is guaranteed that all numbers that describe the experiment are integers.

Output

For each action of the second type print the calculated value. The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 4.

Examples

Input

3 3
1 2 0
2 2
1 2 1
2 3


Output

1.50000
1.66667


Input

4 5
1 3 0 1
2 3
2 1
1 3 2
2 3
2 4


Output

1.66667
1.00000
2.33333
2.66667

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;
template <class T>
struct treap {
  struct node_t {
    T val;
    T sum;
    node_t *lch, *rch;
    int pri;
    int cnt;
    node_t(T v, int p) : val(v), pri(p), cnt(1), sum(v) { lch = rch = NULL; }
  };
  node_t *root;
  treap() : root(NULL) {}
  int count(node_t *t) { return t ? t->cnt : 0; }
  T sum(node_t *t) { return t ? t->sum : 0; }
  int size() { return count(root); }
  node_t *update(node_t *t) {
    t->cnt = count(t->lch) + count(t->rch) + 1;
    t->sum = sum(t->lch) + sum(t->rch) + t->val;
    return t;
  }
  node_t *merge(node_t *l, node_t *r) {
    if (!l || !r) return l ? l : r;
    if (l->pri > r->pri) {
      l->rch = merge(l->rch, r);
      return update(l);
    } else {
      r->lch = merge(l, r->lch);
      return update(r);
    }
  }
  pair<node_t *, node_t *> split(node_t *t, int k) {
    if (!t) return make_pair((node_t *)NULL, (node_t *)NULL);
    if (k <= count(t->lch)) {
      pair<node_t *, node_t *> s = split(t->lch, k);
      t->lch = s.second;
      return make_pair(s.first, update(t));
    } else {
      pair<node_t *, node_t *> s = split(t->rch, k - count(t->lch) - 1);
      t->rch = s.first;
      return make_pair(update(t), s.second);
    }
  }
  node_t *insert(node_t *t, int k, T val, int pri) {
    pair<node_t *, node_t *> s = split(t, k);
    t = merge(s.first, new node_t(val, pri));
    t = merge(t, s.second);
    return update(t);
  }
  node_t *erase(node_t *t, int k) {
    pair<node_t *, node_t *> s1, s2;
    s2 = split(t, k + 1);
    s1 = split(s2.first, k);
    t = merge(s1.first, s2.second);
    return update(t);
  }
  node_t *find(node_t *t, int k) {
    int c = count(t->lch);
    if (k < c) return find(t->lch, k);
    if (k == c) return t;
    return find(t->rch, k - c - 1);
  }
  void add(node_t *t, int k, T val) {
    int c = count(t->lch);
    t->sum += val;
    if (k < c) {
      add(t->lch, k, val);
      return;
    }
    if (k == c) {
      t->val += val;
      return;
    }
    add(t->rch, k - c - 1, val);
  }
  void insert(int k, T val) { root = insert(root, k, val, rand()); }
  void erase(int k) { root = erase(root, k); }
  void add(int k, T val) { add(root, k, val); }
  node_t *find(int k) { return find(root, k); }
  void shift(int l, int r) {
    pair<node_t *, node_t *> a, b, c;
    c = split(root, r);
    b = split(c.first, r - 1);
    a = split(b.first, l);
    root = merge(a.first, b.second);
    root = merge(root, a.second);
    root = merge(root, c.second);
  }
  long long query(int l, int r, node_t *t) {
    int sz = count(t);
    if (l >= sz || r <= 0) return 0;
    if (l <= 0 && r >= sz) return sum(t);
    int c = count(t->lch);
    long long lv = query(l, r, t->lch);
    long long rv = query(l - c - 1, r - c - 1, t->rch);
    return lv + rv + (l <= c && c < r ? t->val : 0);
  }
  long long query(int l, int r) { return query(l, r, root); }
};
template <class T>
struct BIT {
  T *bit;
  int sz;
  BIT(int size = 100000) : sz(size + 1) {
    bit = new T[sz];
    memset(bit, 0, sizeof(T) * sz);
  }
  ~BIT() { delete[] bit; }
  inline void add(int i, T x) {
    for (; i < sz; i += i & -i) bit[i] += x;
  }
  inline T sum(int i) {
    T res = 0;
    for (; i; i -= i & -i) res += bit[i];
    return res;
  }
  inline int find(int k) {
    int lo = 0, hi = 1 << 32 - __builtin_clz(sz - 1), mid;
    while (lo + 1 < hi) {
      mid = (lo + hi) / 2;
      if (mid >= sz || bit[mid] >= k)
        hi = mid;
      else
        k -= bit[lo = mid];
    }
    return hi;
  }
};
int n, q, a[100010];
long long in[100010][3];
int main() {
  vector<pair<long long, long long> > v;
  scanf("%d%d", &n, &q);
  for (int i = 0; i < (int)n; i++)
    scanf("%d", a + i), v.push_back(pair<long long, long long>(a[i], i));
  for (int i = 0; i < (int)q; i++) {
    scanf("%I64d%I64d", in[i], in[i] + 1);
    if (in[i][0] == 1) {
      scanf("%I64d", in[i] + 2);
      v.push_back(pair<long long, long long>(in[i][2], n + i));
    }
  }
  v.push_back(pair<long long, long long>(-inf, inf));
  sort((v).begin(), (v).end());
  BIT<int> bit(v.size() + 1);
  treap<long long> tree;
  for (int i = 0; i < (int)v.size(); i++) tree.insert(i, 0);
  for (int i = 0; i < (int)n; i++) {
    a[i] = lower_bound((v).begin(), (v).end(),
                       pair<long long, long long>(a[i], i)) -
           v.begin();
    bit.add(a[i], 1);
    tree.add(a[i], v[a[i]].first);
  }
  for (int i = 0; i < (int)q; i++) {
    if (in[i][0] == 1) {
      int idx = in[i][1] - 1,
          x = lower_bound((v).begin(), (v).end(),
                          pair<long long, long long>(in[i][2], i + n)) -
              v.begin();
      bit.add(a[idx], -1);
      tree.add(a[idx], -v[a[idx]].first);
      bit.add(a[idx] = x, 1);
      tree.add(a[idx], v[a[idx]].first);
    } else {
      long long x = in[i][1];
      int L = 0, R = n + 1;
      while (L + 1 < R) {
        int m = (L + R) / 2;
        int mi = bit.find(m);
        double s = tree.query(0, mi + 1);
        if (v[mi].first > EPS + (s + x) / m)
          R = m;
        else
          L = m;
      }
      int lo = 1, hi = L;
      while (lo + 2 < hi) {
        int a = (lo * 2 + hi) / 3;
        int b = (lo + hi * 2) / 3;
        int ai = bit.find(a), bi = bit.find(b);
        double l = tree.query(0, ai + 1), r = tree.query(0, bi + 1);
        if ((l + x) / a >= (r + x) / b)
          lo = a;
        else
          hi = b;
      }
      double mn = INF;
      for (int j = lo; j <= hi; j++) {
        int ii = bit.find(j);
        double s = tree.query(0, ii + 1);
        mn = min(mn, (s + x) / j);
      }
      printf("%.20f\n", mn);
    }
  }
  return 0;
}