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_n = 111111, sz = 333, inf = 1111111111;
int n, q, a[max_n], A[max_n], b[sz][2 * sz], l[sz], r[sz];
long long sum[sz], sum2[sz][2 * sz];
void build() {
  for (int i = 0; i < sz; ++i) {
    l[i] = i * sz;
    r[i] = (i + 1) * sz - 1;
    r[i] = min(r[i], n - 1);
    sum[i] = 0;
    for (int j = l[i]; j <= r[i]; ++j) {
      sum[i] += a[j];
      b[i][j - l[i]] = a[j];
      sum2[i][j - l[i]] = a[j];
      if (j > l[i]) {
        sum2[i][j - l[i]] += sum2[i][j - l[i] - 1];
      }
    }
  }
}
void rebuild() {
  for (int i = 0; i < sz; ++i) {
    for (int j = l[i]; j <= r[i]; ++j) {
      a[j] = b[i][j - l[i]];
    }
  }
  build();
}
void er(int x) {
  for (int i = 0; i < sz; ++i) {
    if (l[i] <= r[i]) {
      if (b[i][0] <= x && x <= b[i][r[i] - l[i]]) {
        sum[i] -= x;
        for (int j = l[i]; j <= r[i]; ++j) {
          if (b[i][j - l[i]] == x) {
            for (int k = j; k < r[i]; ++k) {
              b[i][k - l[i]] = b[i][k - l[i] + 1];
            }
            break;
          }
        }
        --r[i];
        for (int j = i + 1; j < sz; ++j) {
          --l[j];
          --r[j];
        }
        sum2[i][0] = b[i][0];
        for (int j = l[i] + 1; j <= r[i]; ++j) {
          sum2[i][j - l[i]] = sum2[i][j - l[i] - 1] + b[i][j - l[i]];
        }
        break;
      }
    }
  }
}
void ins(int x) {
  int last = -1;
  for (int i = 0; i < sz; ++i) {
    if (l[i] <= r[i] || i == 0 && n == 1) {
      int poz = -1;
      if (last <= x && x <= b[i][0]) {
        poz = l[i];
      } else if (b[i][0] <= x && x <= b[i][r[i] - l[i]]) {
        for (int j = l[i] + 1; j <= r[i]; ++j) {
          if (b[i][j - l[i] - 1] <= x && x <= b[i][j - l[i]]) {
            poz = j;
            break;
          }
        }
      }
      if (r[i] == n - 2 && poz == -1) {
        poz = r[i] + 1;
      }
      if (poz != -1) {
        for (int j = r[i] + 1; j > poz; --j) {
          b[i][j - l[i]] = b[i][j - l[i] - 1];
        }
        b[i][poz - l[i]] = x;
        ++r[i];
        sum[i] += x;
        for (int j = i + 1; j < sz; ++j) {
          ++l[j];
          ++r[j];
        }
        sum2[i][0] = b[i][0];
        for (int j = l[i] + 1; j <= r[i]; ++j) {
          sum2[i][j - l[i]] = sum2[i][j - l[i] - 1] + b[i][j - l[i]];
        }
        return;
      }
    }
    last = b[i][r[i] - l[i]];
  }
}
void write() {
  for (int i = 0; i < sz; ++i) {
    if (l[i] < n) {
      cout << "[";
      for (int j = l[i]; j < n && j <= r[i]; ++j) {
        cout << b[i][j - l[i]] << " ";
      }
      cout << "sum = " << sum[i] << "] ";
    }
  }
  cout << endl;
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &A[i]);
    a[i] = A[i];
  }
  for (int i = n; i < n + 1000; ++i) {
    a[i] = inf;
  }
  sort(a, a + n);
  build();
  while (q--) {
    int tp;
    scanf("%d", &tp);
    if (tp == 1) {
      int poz, x;
      scanf("%d%d", &poz, &x);
      --poz;
      er(A[poz]);
      A[poz] = x;
      ins(A[poz]);
    } else {
      long long Q;
      scanf("%I64d", &Q);
      int L = 0, R = n;
      double S = 0;
      for (int i = 0; i < sz; ++i) {
        if (l[i] <= r[i]) {
          S += sum[i];
          if (1LL * (r[i] + 1) * b[i][r[i] - l[i]] - S >= Q) {
            S -= sum[i];
            for (int j = l[i]; j <= r[i]; ++j) {
              S += b[i][j - l[i]];
              if (1LL * (j + 1) * b[i][j - l[i]] - S >= Q) {
                R = j;
                break;
              }
            }
          }
        }
      }
      S = Q;
      --R;
      double last = 1e18, ans = 1e18;
      for (int i = 0; i < sz; ++i) {
        if (l[i] <= r[i]) {
          double qqq = last;
          if (l[i] < r[i]) {
            qqq = (S + sum2[i][r[i] - 1 - l[i]]) / r[i];
          }
          if ((S + sum2[i][r[i] - l[i]]) / (r[i] + 1) > qqq || R <= r[i]) {
            for (int j = l[i]; j <= r[i] && j <= R; ++j) {
              S += b[i][j - l[i]];
              if (last < S / (j + 1)) {
                break;
              }
              last = S / (j + 1);
            }
            break;
          }
          S += sum[i];
          last = S / (r[i] + 1);
        }
      }
      printf("%.5f\n", last);
    }
    if (q % sz == 0) {
      rebuild();
    }
  }
  return 0;
}