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 max_node = 3000000;
long long tree[max_node];
long long tree2[max_node];
long long A[max_node];
map<long long, long long> my, my2;
void update(int node, int start, int _end, int idx, long long val) {
  if (start == _end)
    tree[node] += val;
  else {
    int mid = (start + _end) / 2;
    if (start <= idx && idx <= mid)
      update(node * 2, start, mid, idx, val);
    else
      update(node * 2 + 1, mid + 1, _end, idx, val);
    tree[node] = tree[2 * node] + tree[2 * node + 1];
  }
}
long long query(int node, int start, int _end, int l, int r) {
  if (r < start || l > _end) {
    return 0;
  }
  if (l <= start && _end <= r) return tree[node];
  int mid = (start + _end) / 2;
  long long x1 = query(2 * node, start, mid, l, r);
  long long x2 = query(2 * node + 1, mid + 1, _end, l, r);
  return (x1 + x2);
}
void update2(int node, int start, int _end, int idx, long long val) {
  if (start == _end)
    tree2[node] += val;
  else {
    int mid = (start + _end) / 2;
    if (start <= idx && idx <= mid)
      update2(node * 2, start, mid, idx, val);
    else
      update2(node * 2 + 1, mid + 1, _end, idx, val);
    tree2[node] = tree2[2 * node] + tree2[2 * node + 1];
  }
}
long long query2(int node, int start, int _end, int l, int r) {
  if (r < start || l > _end) {
    return 0;
  }
  if (l <= start && _end <= r) return tree2[node];
  int mid = (start + _end) / 2;
  long long x1 = query2(2 * node, start, mid, l, r);
  long long x2 = query2(2 * node + 1, mid + 1, _end, l, r);
  return (x1 + x2);
}
int main() {
  int n, q;
  cin >> n >> q;
  vector<long long> v;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &A[i]);
    v.push_back(A[i]);
  }
  vector<long long> que[q];
  for (int i = 0; i < q; i++) {
    long long x, y;
    scanf("%I64d%I64d", &x, &y);
    que[i].push_back(x);
    que[i].push_back(y);
    if (x == 1) {
      scanf("%I64d", &x);
      que[i].push_back(x);
      v.push_back(x);
    }
  }
  sort(v.begin(), v.end());
  int cnt = 1;
  long long last = -1;
  for (int i = 0; i < v.size(); i++) {
    if (v[i] != last) {
      my[v[i]] = cnt;
      my2[cnt] = v[i];
      cnt++;
    }
    last = v[i];
  }
  int TT = cnt - 1;
  for (int i = 1; i <= n; i++) {
    update(1, 1, TT, my[A[i]], A[i]);
    update2(1, 1, TT, my[A[i]], 1);
  }
  for (int i = 0; i < q; i++) {
    if (que[i].size() == 2) {
      long long x, y;
      x = que[i][0];
      y = que[i][1];
      int st = 1, En = TT;
      double ans = 1e18;
      while (st <= En) {
        int mid = (st + En) / 2;
        long long sum = query(1, 1, TT, 1, mid);
        long long maxx = my2[mid];
        long long c = query2(1, 1, TT, 1, mid);
        long long sum2 = maxx * c;
        long long sum3 = sum2 - sum;
        long long sum4 = y - sum3;
        double ans2 = maxx;
        if (sum4 > 0 && c != 0) ans2 += (1.0 * sum4 / c);
        if (sum4 < 0 && c != 0) {
          En = mid - 1;
        } else {
          st = mid + 1;
        }
        if (c != 0) ans = min(ans, ans2);
      }
      printf("%.6f\n", ans);
    } else {
      long long x, y, z;
      x = que[i][0];
      y = que[i][1];
      z = que[i][2];
      long long temp = A[y];
      temp = my[temp];
      update(1, 1, TT, temp, -A[y]);
      update2(1, 1, TT, temp, -1);
      A[y] = z;
      z = my[z];
      update(1, 1, TT, z, A[y]);
      update2(1, 1, TT, z, 1);
    }
  }
}