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>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int MAXN = 110000;
const int INF = 1E9 + 233;
struct Splay {
  struct Node {
    int c[2], fa;
    int siz, val;
    long long sum;
  } tr[2 * MAXN];
  int cnt, root;
  int newNode(int k) {
    int x = ++cnt;
    tr[x].c[0] = tr[x].c[1] = tr[x].fa = 0;
    tr[x].siz = 1;
    tr[x].sum = tr[x].val = k;
    return x;
  }
  void pushup(int x) {
    tr[x].siz = tr[tr[x].c[0]].siz + tr[tr[x].c[1]].siz + 1;
    tr[x].sum = tr[tr[x].c[0]].sum + tr[tr[x].c[1]].sum + tr[x].val;
  }
  bool getlr(int x) { return tr[tr[x].fa].c[1] == x; }
  void rotate(int x) {
    int y = tr[x].fa, z = tr[y].fa;
    bool k = getlr(x);
    int w = tr[x].c[k ^ 1];
    if (z) tr[z].c[getlr(y)] = x;
    tr[x].fa = z;
    tr[y].c[k] = w;
    if (w) tr[w].fa = y;
    tr[x].c[k ^ 1] = y;
    tr[y].fa = x;
    pushup(y);
  }
  void splay(int x, int y) {
    while (tr[x].fa != y) {
      if (tr[tr[x].fa].fa != y)
        rotate(getlr(x) ^ getlr(tr[x].fa) ? x : tr[x].fa);
      rotate(x);
    }
    pushup(x);
    if (!y) root = x;
  }
  int find(int k) {
    int x = root, y = 0;
    while (x)
      if (tr[x].val >= k)
        y = x, x = tr[x].c[0];
      else
        x = tr[x].c[1];
    if (y) splay(y, 0);
    return y;
  }
  void insert(int k) {
    if (!root) {
      root = newNode(k);
      return;
    }
    int x = find(k);
    if (!x) {
      x = root;
      while (tr[x].c[1]) x = tr[x].c[1];
      tr[x].c[1] = newNode(k);
      tr[tr[x].c[1]].fa = x;
      splay(tr[x].c[1], 0);
    } else if (!tr[x].c[0]) {
      tr[x].c[0] = newNode(k);
      tr[tr[x].c[0]].fa = x;
      pushup(x);
    } else {
      x = tr[x].c[0];
      while (tr[x].c[1]) x = tr[x].c[1];
      tr[x].c[1] = newNode(k);
      tr[tr[x].c[1]].fa = x;
      splay(tr[x].c[1], 0);
    }
  }
  void erase(int k) {
    int x = find(k);
    if (!tr[x].c[0])
      tr[tr[x].c[1]].fa = 0, root = tr[x].c[1];
    else {
      int y = tr[x].c[0];
      while (tr[y].c[1]) y = tr[y].c[1];
      splay(y, x);
      tr[y].c[1] = tr[x].c[1];
      tr[tr[x].c[1]].fa = y;
      tr[y].fa = 0;
      root = y;
      pushup(y);
    }
  }
  double query(long long k) {
    int x = root, y = 0, z;
    int cnt = 0;
    long long sum = 0;
    while (x) {
      z = x;
      if (tr[x].val == INF || 1ll * tr[x].val * (cnt + tr[tr[x].c[0]].siz) >=
                                  k + sum + tr[tr[x].c[0]].sum)
        y = x, x = tr[x].c[0];
      else {
        cnt += tr[x].siz - tr[tr[x].c[1]].siz;
        sum += tr[x].sum - tr[tr[x].c[1]].sum;
        x = tr[x].c[1];
      }
    }
    splay(y, 0);
    double ret = 1.0 * (k + tr[tr[y].c[0]].sum) / tr[tr[y].c[0]].siz;
    splay(z, 0);
    return ret;
  }
} splay;
int h[MAXN];
int read() {
  int x = 0;
  char ch = 0;
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x;
}
long long readll() {
  long long x = 0;
  char ch = 0;
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &h[i]), splay.insert(h[i]);
  splay.insert(INF);
  while (q--) {
    int opt = read();
    if (opt == 1) {
      int p = read(), x = read();
      splay.erase(h[p]);
      splay.insert(x);
      h[p] = x;
    } else {
      long long v = readll();
      printf("%.5lf\n", splay.query(v));
    }
  }
  return 0;
}