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 MAXN = 2 * 105000;
const long long INF = 2 * 1000 * 1000 * 1000;
void update(long long f[], int pos, long long delta) {
  for (; pos < MAXN; pos = (pos | (pos + 1))) f[pos] += delta;
}
long long getsum(long long f[], int pos) {
  long long res = 0;
  for (; pos > 0; pos = (pos & (pos + 1)) - 1) res += f[pos];
  return res;
}
long long getsum(long long f[], int l, int r) {
  return getsum(f, r) - getsum(f, l - 1);
}
int n, q;
int qt[MAXN];
int pos[MAXN], x[MAXN];
int h[MAXN];
long long vol[MAXN];
long long num[MAXN], sum[MAXN];
map<int, bool> has;
map<long long, int> id;
long long val[MAXN];
int ind;
double best;
bool can(int pos, long long vol, bool upd = false) {
  int curval = val[pos];
  long long sump = getsum(sum, 1, pos - 1);
  long long nump = getsum(num, 1, pos - 1);
  if (curval == INF) {
    if (upd) best = 1.0 * (sump + vol) / nump;
    return true;
  }
  long long add = 1.0 * nump * curval - sump;
  if (add < vol)
    return false;
  else {
    if (upd) best = 1.0 * (sump + vol) / nump;
    return true;
  }
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &h[i]);
    has[h[i]] = true;
  }
  for (int i = 1; i <= q; i++) {
    scanf("%d", &qt[i]);
    if (qt[i] == 1) {
      scanf("%d %d", &pos[i], &x[i]);
      has[x[i]] = true;
    } else {
      scanf("%I64d", &vol[i]);
    }
  }
  ind = 1;
  for (map<int, bool>::iterator it = has.begin(); it != has.end(); it++) {
    int cur = it->first;
    val[ind] = cur;
    id[cur] = ind;
    ind++;
  }
  val[ind] = INF;
  id[INF] = ind;
  ind++;
  for (int i = 1; i <= n; i++) {
    update(num, id[h[i]], 1);
    update(sum, id[h[i]], h[i]);
  }
  for (int i = 1; i <= q; i++) {
    if (qt[i] == 1) {
      int prev = h[pos[i]];
      update(num, id[prev], -1);
      update(sum, id[prev], -prev);
      h[pos[i]] = x[i];
      int cur = x[i];
      update(num, id[cur], 1);
      update(sum, id[cur], cur);
    } else {
      best = -1;
      int l = 1, r = ind - 1;
      while (l < r) {
        int mid = (l + r) / 2;
        if (can(mid, vol[i]))
          r = mid;
        else
          l = mid + 1;
      }
      can(l, vol[i], true);
      printf("%.12lf\n", best);
    }
  }
  return 0;
}