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 long long INF = 1000000007;
const long long DMAX = 300000 + 15;
const long long MOD = 1000000007;
template <class T>
inline void read(T &x) {
  x = 0;
  T f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') {
      f = -1;
    }
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  x *= f;
}
template <class T>
void print(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  int a[20];
  int cnt = 0;
  do {
    a[++cnt] = x % 10;
    x /= 10;
  } while (x > 0);
  for (int i = cnt; i >= 1; i--) {
    putchar(a[i] + '0');
  }
  puts("");
}
struct SegTree {
  long long sum;
  long long l, r;
  long long cnt;
};
SegTree tr[DMAX << 2];
void pushup(long long p) {
  tr[p].cnt = tr[p << 1].cnt + tr[p << 1 | 1].cnt;
  tr[p].sum = tr[p << 1].sum + tr[p << 1 | 1].sum;
}
void build(long long p, long long l, long long r) {
  tr[p].l = l, tr[p].r = r;
  if (l == r) {
    return;
  }
  long long mid = (l + r) >> 1;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
struct DEF {
  long long sum, cnt;
};
struct quest {
  long long ope;
  long long x, y;
};
quest q[DMAX];
long long n, m;
long long h[DMAX];
long long len;
long long a[DMAX], des = 0;
void modify(long long p, long long pos, long long val, long long wer) {
  if (tr[p].l == tr[p].r) {
    tr[p].sum += val * wer;
    tr[p].cnt += wer;
    return;
  }
  long long mid = (tr[p].l + tr[p].r) >> 1;
  if (pos <= mid) {
    modify(p << 1, pos, val, wer);
  } else {
    modify(p << 1 | 1, pos, val, wer);
  }
  pushup(p);
}
DEF query(long long p, long long l, long long r) {
  if (l > r) {
    return DEF{0, 0};
  }
  if (r < tr[p].l || tr[p].r < l) {
    return DEF{0, 0};
  }
  if (l <= tr[p].l && tr[p].r <= r) {
    return DEF{tr[p].sum, tr[p].cnt};
  }
  long long mid = (tr[p].l + tr[p].r) >> 1;
  DEF t, j;
  t.sum = t.cnt = j.sum = j.cnt = 0;
  if (l <= mid) {
    t = query(p << 1, l, r);
  }
  if (r > mid) {
    j = query(p << 1 | 1, l, r);
  }
  return DEF{t.sum + j.sum, t.cnt + j.cnt};
}
bool check(double val, double pol) {
  long long pos = upper_bound(a + 1, a + len + 1, (double)val) - a - 1;
  DEF red = query(1, 1, pos);
  if (red.cnt * val - red.sum >= pol) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  read(n), read(m);
  for (int i = 1; i <= n; i++) {
    read(h[i]);
    a[++des] = h[i];
  }
  for (int i = 1; i <= m; i++) {
    read(q[i].ope);
    if (q[i].ope == 1) {
      read(q[i].x), read(q[i].y);
      a[++des] = q[i].y;
    }
    if (q[i].ope == 2) {
      read(q[i].x);
    }
  }
  sort(a + 1, a + des + 1);
  len = unique(a + 1, a + des + 1) - a - 1;
  build(1, 1, len);
  for (int i = 1; i <= n; i++) {
    long long pos = lower_bound(a + 1, a + len + 1, h[i]) - a;
    modify(1, pos, h[i], 1);
  }
  for (int i = 1; i <= m; i++) {
    if (q[i].ope == 1) {
      long long pos = lower_bound(a + 1, a + len + 1, h[q[i].x]) - a;
      modify(1, pos, h[q[i].x], -1);
      h[q[i].x] = q[i].y;
      pos = lower_bound(a + 1, a + len + 1, h[q[i].x]) - a;
      modify(1, pos, h[q[i].x], 1);
    }
    if (q[i].ope == 2) {
      double l = 0, r = q[i].x + 1e9;
      for (int j = 0; j <= 100; j++) {
        double mid = (l + r) / 2;
        if (check(mid, q[i].x)) {
          r = mid;
        } else {
          l = mid;
        }
      }
      printf("%.8lf\n", l);
    }
  }
  return 0;
}