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;
int n, m, x, p[100100], nrofel, y, cn, tip;
long long S, ls, sum;
struct Tr {
  Tr *l, *r;
  int cn, k, pr;
  long long s;
  Tr(int _k) {
    cn = 1;
    k = _k;
    s = _k;
    pr = rand();
    l = r = NULL;
  }
};
Tr *R;
long long fs(Tr *t) {
  if (!t) return 0;
  return t->s;
}
int cnt(Tr *t) {
  if (!t) return 0;
  return t->cn;
}
void upd(Tr *&t) {
  if (!t) return;
  t->cn = cnt(t->l) + cnt(t->r) + 1;
  t->s = fs(t->l) + fs(t->r) + t->k;
}
void split(Tr *t, Tr *&l, Tr *&r, int k) {
  if (!t) {
    l = r = t;
    return;
  }
  if (k <= t->k)
    split(t->l, l, t->l, k), r = t;
  else
    split(t->r, t->r, r, k), l = t;
  upd(t);
}
void merge(Tr *&t, Tr *l, Tr *r) {
  if (!l || !r) {
    t = l ? l : r;
    upd(t);
    return;
  }
  if (l->pr > r->pr)
    merge(l->r, l->r, r), t = l;
  else
    merge(r->l, l, r->l), t = r;
  upd(t);
}
void insert(Tr *&t, Tr *it) {
  if (!t) {
    t = it;
    return;
  }
  if (it->pr > t->pr)
    split(t, it->l, it->r, it->k), t = it;
  else if (it->k == t->k) {
    if (rand() % 2)
      insert(t->l, it);
    else
      insert(t->r, it);
  } else if (it->k < t->k)
    insert(t->l, it);
  else
    insert(t->r, it);
  upd(t);
}
void erase(Tr *&t, int x) {
  if (t->k == x) {
    merge(t, t->l, t->r);
    return;
  }
  if (x < t->k)
    erase(t->l, x);
  else
    erase(t->r, x);
  upd(t);
}
void dfs(Tr *t) {
  if (!t) return;
  nrofel += cnt(t->l);
  if (t->k == (1 << 30) || 1LL * t->k * nrofel - S - sum - fs(t->l) >= 0) {
    ls = sum + fs(t->l);
    cn = nrofel;
    nrofel -= cnt(t->l);
    dfs(t->l);
  } else {
    nrofel++;
    sum += fs(t->l) + t->k;
    dfs(t->r);
  }
}
int main() {
  cin >> n >> m;
  Tr *it = new Tr(1 << 30);
  insert(R, it);
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    p[i] = x;
    Tr *it = new Tr(x);
    insert(R, it);
  }
  for (int i = 1; i <= m; ++i) {
    cin >> tip;
    if (tip == 2) {
      nrofel = 0;
      sum = 0;
      cin >> S;
      if (i == 4) {
        i++;
        i--;
      }
      dfs(R);
      long double t = S + ls;
      t /= cn;
      cout << fixed << setprecision(5) << t << "\n";
    } else {
      cin >> x >> y;
      erase(R, p[x]);
      p[x] = y;
      Tr *it = new Tr(y);
      insert(R, it);
    }
  }
  return 0;
}