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 N = 200010;
vector<int> v;
int find(int x) { return lower_bound(v.begin(), v.end(), x) - v.begin(); }
int a[N];
struct Node {
  int l, r;
  int cnt;
  long long sum;
} tr[N << 2];
void pushup(int u) {
  tr[u].cnt = tr[u << 1].cnt + tr[u << 1 | 1].cnt;
  tr[u].sum = tr[u << 1].sum + tr[u << 1 | 1].sum;
}
void build(int u, int l, int r) {
  tr[u] = {l, r};
  if (l == r) return;
  int mid = l + r >> 1;
  build(u << 1, l, mid), build(u << 1 | 1, mid + 1, r);
}
void modify(int u, int x, int c) {
  if (tr[u].l == x and tr[u].r == x) {
    tr[u].cnt += c;
    tr[u].sum += c * v[x];
    return;
  }
  int mid = tr[u].l + tr[u].r >> 1;
  if (x <= mid)
    modify(u << 1, x, c);
  else
    modify(u << 1 | 1, x, c);
  pushup(u);
}
long long w;
double query(int u, int cnt, long long sum) {
  if (tr[u].l == tr[u].r) {
    cnt += tr[u].cnt;
    sum += tr[u].sum;
    return (double)(w + sum) / cnt;
  }
  int mid = tr[u].l + tr[u].r >> 1;
  if ((long long)(cnt + tr[u << 1].cnt) * v[mid + 1] - (sum + tr[u << 1].sum) >=
      w)
    return query(u << 1, cnt, sum);
  return query(u << 1 | 1, cnt + tr[u << 1].cnt, sum + tr[u << 1].sum);
}
struct Option {
  int op, p, x;
  long long w;
} q[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    v.push_back(a[i]);
  }
  for (int i = 0; i < m; i++) {
    int op;
    scanf("%d", &op);
    if (op == 1) {
      int p, x;
      scanf("%d%d", &p, &x);
      q[i] = {op, p, x};
      v.push_back(x);
    } else {
      scanf("%lld", &w);
      q[i].op = op, q[i].w = w;
    }
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  build(1, 0, v.size() - 1);
  v.push_back(2e9);
  for (int i = 1; i <= n; i++) modify(1, find(a[i]), 1);
  for (int i = 0; i < m; i++) {
    int op = q[i].op;
    if (op == 1) {
      int p = q[i].p, x = q[i].x;
      modify(1, find(a[p]), -1);
      a[p] = x;
      modify(1, find(a[p]), 1);
    } else {
      w = q[i].w;
      printf("%lf\n", query(1, 0, 0));
    }
  }
  return 0;
}