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 inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
const int maxn = 1000 * 1000 + 10;
const double eps = 0.000000001;
struct Treap {
  int x, y, l, r, cnt, mn;
  long long sum;
};
int fre, root;
Treap t[maxn];
void recalc(int v) {
  t[v].sum = t[t[v].l].sum + t[t[v].r].sum + t[v].x;
  t[v].cnt = t[t[v].l].cnt + t[t[v].r].cnt + 1;
  t[v].mn = min(min(t[t[v].l].mn, t[t[v].r].mn), t[v].x);
  return;
}
pair<int, int> split(int v, int x) {
  if (!v) return make_pair(0, 0);
  if (x < t[v].x) {
    pair<int, int> res = split(t[v].l, x);
    t[v].l = res.second;
    recalc(v);
    res.second = v;
    return res;
  } else {
    pair<int, int> res = split(t[v].r, x);
    t[v].r = res.first;
    recalc(v);
    res.first = v;
    return res;
  }
}
int merg(int t1, int t2) {
  if (!t1) return t2;
  if (!t2) return t1;
  if (t[t1].y > t[t2].y) {
    t[t1].r = merg(t[t1].r, t2);
    recalc(t1);
    return t1;
  } else {
    t[t2].l = merg(t1, t[t2].l);
    recalc(t2);
    return t2;
  }
}
void add(int x) {
  t[++fre].x = x;
  t[fre].y = (rand() << 16) + rand();
  recalc(fre);
  pair<int, int> res = split(root, x);
  root = merg(res.first, merg(fre, res.second));
  return;
}
void sw(int x, int nx) {
  if (x == nx) return;
  if (nx > x) {
    pair<int, int> resl = split(root, x);
    pair<int, int> resr = split(resl.first, x - 1);
    resl = split(resl.second, nx);
    root = merg(resr.first, merg(t[resr.second].l, t[resr.second].r));
    t[resr.second].l = t[resr.second].r = 0;
    t[resr.second].x = nx;
    recalc(resr.second);
    root = merg(root, merg(resl.first, merg(resr.second, resl.second)));
  } else {
    pair<int, int> resl = split(root, x - 1);
    pair<int, int> resr = split(resl.second, x);
    resl = split(resl.first, nx);
    root = merg(merg(t[resr.first].l, t[resr.first].r), resr.second);
    t[resr.first].l = t[resr.first].r = 0;
    t[resr.first].x = nx;
    recalc(resr.first);
    root = merg(merg(resl.first, merg(resr.first, resl.second)), root);
  }
  return;
}
bool check(double x, long long v) {
  pair<int, int> res = split(root, min((long long)x, inf + 0ll));
  if (x * t[res.first].cnt - t[res.first].sum + eps >= v) {
    root = merg(res.first, res.second);
    return true;
  } else {
    root = merg(res.first, res.second);
    return false;
  }
}
int test;
double get(long long v) {
  double L = 0, R = 1000ll * 1000 * 1000 * 1000 * 1000 * 100, mid;
  for (int i = 0; i < 100; ++i) {
    mid = (L + R) / 2;
    if (check(mid, v))
      R = mid;
    else
      L = mid;
  }
  return R;
}
void print(int v, int h) {
  if (!v) return;
  print(t[v].r, h + 2);
  for (int i = 0; i < h; ++i) cout << ' ';
  cout << t[v].x << '\n';
  print(t[v].l, h + 2);
  return;
}
int n, q, a[maxn], pos, x;
long long v;
int main() {
  scanf("%d%d", &n, &q);
  int cur = inf;
  t[0].mn = inf;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    add(a[i]);
  }
  for (int i = 1; i <= q; ++i) {
    scanf("%d", &test);
    if (test == 1) {
      scanf("%d%d", &pos, &x);
      cerr << pos << ' ' << x << '\n';
      sw(a[pos], x);
      a[pos] = x;
    } else {
      scanf("%I64d", &v);
      printf("%.10lf\n", max(t[root].mn + 0.0, get(v)));
    }
  }
  return 0;
}