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;
long long x[100008];
struct node {
  long long l, r, ls, rs, id, cnt;
  long long w;
};
struct segtree {
  long long cnt;
  node tr[100008 * 40];
  void up(long long rt) {
    tr[rt].w = tr[tr[rt].ls].w + tr[tr[rt].rs].w;
    tr[rt].cnt = tr[tr[rt].ls].cnt + tr[tr[rt].rs].cnt;
    if (tr[tr[rt].ls].cnt)
      tr[rt].id = tr[tr[rt].ls].id;
    else if (tr[tr[rt].rs].cnt)
      tr[rt].id = tr[tr[rt].rs].id;
    else
      tr[rt].id = 0;
  }
  void add(long long a, long long b, long long rt) {
    long long l = tr[rt].l, r = tr[rt].r, m = (l + r) >> 1;
    if (l == r) {
      tr[rt].cnt += b;
      tr[rt].id = (tr[rt].cnt) ? rt : 0;
      tr[rt].w = tr[rt].cnt * a;
      return;
    }
    if (a <= m) {
      if (!tr[rt].ls) {
        tr[rt].ls = ++cnt;
        tr[cnt].l = l;
        tr[cnt].r = m;
      }
      add(a, b, tr[rt].ls);
    } else {
      if (!tr[rt].rs) {
        tr[rt].rs = ++cnt;
        tr[cnt].l = m + 1;
        tr[cnt].r = r;
      }
      add(a, b, tr[rt].rs);
    }
    up(rt);
  }
  double que(long long v, long long cntl, long long wl, long long rt) {
    long long l = tr[rt].l, r = tr[rt].r;
    if (l == r) return 1.0 * (wl + tr[rt].w + v) / (cntl + tr[rt].cnt);
    if (tr[tr[rt].ls].cnt && tr[tr[rt].rs].cnt) {
      if ((wl + tr[tr[rt].ls].w + v) * (tr[tr[tr[rt].rs].id].cnt) <
          (cntl + tr[tr[rt].ls].cnt) * (tr[tr[tr[rt].rs].id].w))
        return que(v, cntl, wl, tr[rt].ls);
      else if ((wl + tr[tr[rt].ls].w + v) * (tr[tr[tr[rt].rs].id].cnt) >
               (cntl + tr[tr[rt].ls].cnt) * (tr[tr[tr[rt].rs].id].w))
        return que(v, cntl + tr[tr[rt].ls].cnt, wl + tr[tr[rt].ls].w,
                   tr[rt].rs);
      else
        return 1.0 * (wl + tr[tr[rt].ls].w + v) / (cntl + tr[tr[rt].ls].cnt);
    } else if (tr[tr[rt].ls].cnt)
      return que(v, cntl, wl, tr[rt].ls);
    else if (tr[tr[rt].rs].cnt)
      return que(v, cntl + tr[tr[rt].ls].cnt, wl + tr[tr[rt].ls].w, tr[rt].rs);
    else
      exit(-1);
  }
} tree;
signed main() {
  long long i, n, q, typ, a, b;
  long long c;
  scanf("%lld %lld", &n, &q);
  ++tree.cnt;
  tree.tr[1].l = 0;
  tree.tr[1].r = 1000000000000000000;
  for (i = 1; i <= n; ++i) {
    scanf("%lld", &x[i]);
    tree.add(x[i], 1, 1);
  }
  while (q--) {
    scanf("%lld", &typ);
    if (typ == 1) {
      scanf("%lld %lld", &a, &b);
      tree.add(x[a], -1, 1);
      x[a] = b;
      tree.add(x[a], 1, 1);
    } else {
      scanf("%lld", &c);
      printf("%.5lf\n", tree.que(c, 0, 0, 1));
    }
  }
  return 0;
}