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 = 100 * 1000 * 8 + 100;
const long long o = 100 * 1000;
const long double oo = o * o * o + 1;
const long double eps = 1e-7;
long long n, q, tube[maxn], cnt[maxn], sum[maxn];
vector<long long> query[maxn];
vector<long long> val;
vector<long double> ans;
void add(int ind, long long vl, int x, int segl, int segr);
long double bin(long double f, long double e, long double x);
bool chk(long double md, long double x);
long long getnum(int ql, int qr, int x, int segl, int segr);
long long getsum(int ql, int qr, int x, int segl, int segr);
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> tube[i];
    val.push_back(tube[i]);
  }
  for (int i = 0; i < q; i++) {
    int t;
    cin >> t;
    long long x, y;
    if (t == 1) {
      cin >> x >> y;
      x--;
      query[i].push_back(t);
      query[i].push_back(x);
      query[i].push_back(y);
      val.push_back(y);
    } else {
      cin >> x;
      query[i].push_back(t);
      query[i].push_back(x);
    }
  }
  sort(val.begin(), val.end());
  val.resize(unique(val.begin(), val.end()) - val.begin());
  for (int i = 0; i < n; i++)
    tube[i] = lower_bound(val.begin(), val.end(), tube[i]) - val.begin();
  for (int i = 0; i < q; i++)
    if (query[i].size() > 2)
      query[i][query[i].size() - 1] =
          lower_bound(val.begin(), val.end(), query[i][query[i].size() - 1]) -
          val.begin();
  for (int i = 0; i < n; i++) add(tube[i], 1, 1, 0, val.size() + 1);
  for (int i = 0; i < q; i++) {
    int t = query[i][0];
    if (t == 1) {
      cerr << sum[1] << endl;
      int x = query[i][1], y = query[i][2];
      add(tube[x], -1, 1, 0, val.size() + 1);
      tube[x] = y;
      add(tube[x], 1, 1, 0, val.size() + 1);
      cerr << sum[1] << endl;
    } else {
      long double x = query[i][1];
      ans.push_back(bin(0, oo, x));
    }
  }
  for (int i = 0; i < ans.size(); i++)
    cout << setprecision(4) << fixed << ans[i] << '\n';
  return 0;
}
void add(int ind, long long vl, int x, int segl, int segr) {
  if (segr - segl < 2) {
    cnt[x] += vl;
    sum[x] += vl * val[ind];
    return;
  }
  int mid = (segl + segr) / 2;
  if (ind < mid)
    add(ind, vl, 2 * x, segl, mid);
  else
    add(ind, vl, 2 * x + 1, mid, segr);
  cnt[x] = cnt[2 * x] + cnt[2 * x + 1];
  sum[x] = sum[2 * x] + sum[2 * x + 1];
}
long double bin(long double f, long double e, long double x) {
  for (int i = 0; i < 250; i++) {
    long double mid = (f + e) / 2;
    if (chk(mid, x))
      e = mid;
    else
      f = mid;
  }
  return e;
}
bool chk(long double md, long double x) {
  long long md2 = md;
  md2 = lower_bound(val.begin(), val.end(), md2) - val.begin();
  long double res = getsum(0, md2, 1, 0, val.size() + 1);
  long double rt = getnum(0, md2, 1, 0, val.size() + 1);
  res = rt * md - res;
  if (x < res + eps) return true;
  return false;
}
long long getnum(int ql, int qr, int x, int segl, int segr) {
  if (ql <= segl && qr >= segr - 1) return cnt[x];
  long long res = 0, mid = (segl + segr) / 2;
  if (ql < mid) res += getnum(ql, qr, 2 * x, segl, mid);
  if (qr >= mid) res += getnum(ql, qr, 2 * x + 1, mid, segr);
  return res;
}
long long getsum(int ql, int qr, int x, int segl, int segr) {
  if (ql <= segl && qr >= segr - 1) return sum[x];
  long long res = 0, mid = (segl + segr) / 2;
  if (ql < mid) res += getsum(ql, qr, 2 * x, segl, mid);
  if (qr >= mid) res += getsum(ql, qr, 2 * x + 1, mid, segr);
  return res;
}