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 nid = 0;
struct BIT {
  long long lowbit(long long x) { return x & (-x); }
  long long s[200001];
  BIT() { memset(s, 0, sizeof(s)); }
  void update(long long pos, long long val) {
    while (pos <= 200000) {
      s[pos] += val;
      pos += lowbit(pos);
    }
  }
  long long query(long long pos) {
    long long ret = 0;
    while (pos) {
      ret += s[pos];
      pos -= lowbit(pos);
    }
    return ret;
  }
} cnt, sum;
struct data {
  long long val;
  long long old_id;
  bool operator<(data that) const { return val < that.val; }
} D[200001];
void makeNewVal(long long v) {
  nid++;
  D[nid].val = v;
  D[nid].old_id = nid;
}
long long id[200001];
long long mapToNewID[200001];
struct query {
  string type;
  long long x;
  long long id;
};
vector<query> Q;
long long p[200001];
long long toRight(long long x) {
  long long L = x - 1, R = nid, M;
  while (R - L > 1) {
    M = (L + R) / 2;
    if (cnt.query(M) - cnt.query(x - 1) > 0)
      R = M;
    else
      L = M;
  }
  return R;
}
long long toLeft(long long x) {
  long long L = 1, R = x + 1, M;
  while (R - L > 1) {
    M = (L + R) / 2;
    if (cnt.query(x) - cnt.query(M - 1) > 0)
      L = M;
    else
      R = M;
  }
  return L;
}
double solve(double A) {
  long long L = toRight(1), R = nid + 1, M;
  while (R - L > 1) {
    M = (L + R) / 2;
    long long lastVal = toLeft(M);
    double pointVal = D[M].val;
    double num = cnt.query(M);
    double total = sum.query(M);
    double gaps = num * pointVal - total;
    if (gaps <= A)
      L = M;
    else
      R = M;
  }
  M = L;
  long long lastVal = toLeft(M);
  double pointVal = D[M].val;
  double num = cnt.query(M);
  double total = sum.query(M);
  double gaps = num * pointVal - total;
  if (gaps <= A)
    L = M;
  else
    R = M;
  return (A - gaps) / num + pointVal;
}
int MAIN() {
  long long n, nq;
  cin >> n >> nq;
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    makeNewVal(x);
    id[i] = nid;
    query t;
    t.type = "ADD";
    t.id = nid;
    Q.push_back(t);
  }
  memset(p, 0, sizeof(p));
  for (long long i = 1; i <= nq; i++) {
    long long type, x, y;
    cin >> type;
    if (type == 1) {
      long long pos, changeTo;
      cin >> pos >> changeTo;
      query t;
      t.type = "DEL";
      t.id = id[pos];
      Q.push_back(t);
      makeNewVal(changeTo);
      id[pos] = nid;
      t.type = "ADD";
      t.id = id[pos];
      Q.push_back(t);
    } else {
      cin >> x;
      query t;
      t.type = "QUERY";
      t.x = x;
      Q.push_back(t);
    }
  }
  sort(D + 1, D + 1 + nid);
  for (long long i = 1; i <= nid; i++) mapToNewID[D[i].old_id] = i;
  for (long long i = 0; i < Q.size(); i++) {
    if (Q[i].type == "QUERY") {
      cout << solve(Q[i].x) << endl;
    }
    if (Q[i].type == "ADD") {
      long long id = mapToNewID[Q[i].id];
      cnt.update(id, 1);
      sum.update(id, D[id].val);
      p[id] = D[id].val;
    }
    if (Q[i].type == "DEL") {
      long long id = mapToNewID[Q[i].id];
      cnt.update(id, -1);
      sum.update(id, -D[id].val);
      p[id] = 0;
    }
  }
  return 0;
}
int main() {
  ios ::sync_with_stdio(false);
  cout << fixed << setprecision(16);
  return MAIN();
}