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 int tree[2][200100 + 1];
long long int query(int ind, int x) {
  long long int sum = 0;
  for (x++; x > 0; x -= x & (-x)) sum += tree[ind][x];
  return sum;
}
void update(int ind, int x, long long int by) {
  if (x < 0) return;
  for (x++; x <= 200100; x += x & (-x)) tree[ind][x] += by;
}
int n, qq;
set<pair<long long int, int> > h;
map<long long int, int> pos[100100];
long long int q[100100][3];
set<pair<long long int, int> >::iterator it;
int num;
long long int hgt[200100];
long long int cur[100100];
vector<long long int> v;
double calcula(double h) {
  int ind = upper_bound(hgt, hgt + num, (long long int)h) - hgt;
  long long int nn = query(1, ind - 1);
  long long int sum = query(0, ind - 1);
  return h * nn - sum;
}
int main() {
  while (scanf("%d %d", &n, &qq) != EOF) {
    h.clear();
    v.clear();
    for (int i = 0; i < (n); i++) {
      long long int x;
      scanf("%lld", &x);
      h.insert(make_pair(x, i));
      v.push_back(x);
    }
    for (int i = 0; i < (qq); i++) {
      long long int a, b, c;
      scanf("%lld", &a);
      q[i][0] = a;
      if (a == 1) {
        scanf("%lld %lld", &b, &c);
        b--;
        h.insert(make_pair(c, b));
        q[i][1] = b;
        q[i][2] = c;
      } else {
        scanf("%lld", &b);
        q[i][1] = b;
      }
    }
    num = 0;
    for (it = h.begin(); it != h.end(); it++) {
      hgt[num] = it->first;
      pos[it->second][it->first] = num++;
    }
    memset(tree, 0, sizeof(tree));
    for (int i = 0; i < (n); i++) {
      int ind = pos[i][v[i]];
      update(0, ind, v[i]);
      update(1, ind, 1);
      cur[i] = v[i];
    }
    for (int i = 0; i < (qq); i++) {
      if (q[i][0] == 1) {
        int p = q[i][1];
        long long int x = q[i][2];
        int ind = pos[p][x];
        update(0, ind, x);
        update(1, ind, 1);
        update(0, pos[p][cur[p]], -cur[p]);
        update(1, pos[p][cur[p]], -1);
        cur[p] = x;
      } else {
        double a = 0;
        double b = 1e16;
        double res = 0;
        while (1) {
          if (fabs(b - a) <= 1e-5) break;
          double me = (a + b) / 2.0;
          double x = calcula(me);
          if (x > q[i][1]) {
            b = me;
            res = me;
          } else {
            a = me;
          }
        }
        printf("%lf\n", res);
      }
    }
  }
  return 0;
}