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, Q;
const int n = 1 << 18;
int H[100000];
int T, A, B;
vector<int> x;
struct Node {
  long long val;
  int l, r;
  Node() { val = 0, l = r = -1; }
  Node(long long val, int l, int r) : val(val), l(l), r(r) {}
};
struct SegTree {
  Node nd[n * 2];
  int ndptr;
  SegTree() { ndptr = 1; }
  int add(int a, int b, int k, int l, int r, long long s) {
    if (r <= a || b <= l) return k;
    if (k == -1) {
      k = ndptr++;
      nd[k] = Node(0, -1, -1);
    }
    if (a <= l && r <= b)
      nd[k].val += s;
    else {
      nd[k].l = add(a, b, nd[k].l, l, (l + r) / 2, s);
      nd[k].r = add(a, b, nd[k].r, (l + r) / 2, r, s);
    }
    return k;
  }
  long long query(int a, int b, int k, int l, int r) {
    if (r <= a || b <= l || k == -1) return 0LL;
    if (l + 1 == r) return nd[k].val;
    return nd[k].val + query(a, b, nd[k].l, l, (l + r) / 2) +
           query(a, b, nd[k].r, (l + r) / 2, r);
  }
} sz, sum;
void change(int v, int h, bool at = false) {
  if (!at) {
    int th = lower_bound((x).begin(), (x).end(), (H[v])) - (x).begin();
    sz.add(th, n, 0, 0, n, -1);
    sum.add(th, n, 0, 0, n, -H[v]);
  }
  H[v] = h;
  h = lower_bound((x).begin(), (x).end(), (h)) - (x).begin();
  sz.add(h, n, 0, 0, n, 1);
  sum.add(h, n, 0, 0, n, H[v]);
}
int ta[100000];
int tb[100000];
int tc[100000];
int td[100000];
long long ts[100000];
void read_init() {
  for (int(i) = 0; (i) < (N); (i)++) scanf("%d", &td[i]), x.push_back(td[i]);
  for (int(i) = 0; (i) < (Q); (i)++) {
    scanf("%d", &ta[i]);
    if (ta[i] == 1)
      scanf("%d%d", &tb[i], &tc[i]), x.push_back(tc[i]);
    else
      cin >> ts[i];
  }
}
int main() {
  scanf("%d%d", &N, &Q);
  read_init();
  sort((x).begin(), (x).end());
  for (int(i) = 0; (i) < (N); (i)++) {
    A = td[i];
    change(i, A, true);
  }
  for (int(i) = 0; (i) < (Q); (i)++) {
    T = ta[i];
    if (T == 1) {
      A = tb[i], B = tc[i];
      A--;
      change(A, B);
    } else {
      long long tt = ts[i];
      double res = 0.0;
      long long lb = -1, ub = 1LL << 60;
      while (ub - lb > 1) {
        long long mid = (lb + ub) / 2;
        int faa =
            upper_bound((x).begin(), (x).end(), (min(1145141919LL, mid))) -
            (x).begin();
        faa--;
        if (faa == -1) faa = 0;
        long long t1 = sz.query(faa, faa + 1, 0, 0, n);
        long long t2 = sum.query(faa, faa + 1, 0, 0, n);
        double aaa = double(t1) * mid - t2;
        long long fs;
        if (aaa > (1LL << 60))
          fs = 1LL << 60;
        else
          fs = t1 * mid - t2;
        if (fs > tt)
          ub = mid;
        else {
          if (t1) {
            res = max(res, min(double(tt + t2) / t1, double(mid + 1.0 - 1e-7)));
          }
          lb = mid;
        }
      }
      printf("%.12f\n", res);
    }
  }
}