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;
int key = 1;
struct event {
  long long val, id, t, p;
  event(int v_, int id_, int t_) {
    val = v_;
    id = id_;
    t = t_;
    p = 0;
  }
  bool operator<(event B) const {
    if (key == 1 && val != B.val) return val < B.val;
    if (key == 2 && t != B.t) return t < B.t;
    if (val != B.val) return val < B.val;
    if (t != B.t) return t < B.t;
    if (id != B.id) return id < B.id;
    return p < B.p;
  }
};
vector<event> e, ch;
vector<pair<int, long long> > c;
int last[100005], val[100005], here[800005];
long long lazy[800005];
int m;
void Set(int p, int val, int s = 0, int e = m, int x = 1) {
  if (e - s == 1) {
    here[x] = val;
    return;
  }
  int mid = (s + e) / 2;
  if (p < mid)
    Set(p, val, s, mid, 2 * x);
  else
    Set(p, val, mid, e, 2 * x + 1);
  here[x] = here[2 * x] + here[2 * x + 1];
}
int getth(int k, int s = 0, int e = m, int x = 1) {
  if (e - s == 1) return s;
  int mid = (s + e) / 2;
  if (here[2 * x] >= k)
    return getth(k, s, mid, 2 * x);
  else
    return getth(k - here[2 * x], mid, e, 2 * x + 1);
}
void add(int l, int r, int val, int s = 0, int e = m, int x = 1) {
  if (l <= s && e <= r) {
    lazy[x] += val;
    return;
  }
  int mid = (s + e) / 2;
  if (l < mid) add(l, r, val, s, mid, 2 * x);
  if (r > mid) add(l, r, val, mid, e, 2 * x + 1);
}
long long getSum(int p, int s = 0, int e = m, int x = 1) {
  long long ans = 0;
  while (1) {
    ans += lazy[x];
    if (e - s == 1) break;
    int mid = (s + e) / 2;
    if (p < mid) {
      e = mid;
      x = 2 * x;
    } else {
      s = mid;
      x = 2 * x + 1;
    }
  }
  return ans;
}
int main() {
  fill(last, last + 100000, -1);
  int n, q;
  cin >> n >> q;
  int type, p, x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    e.push_back(event(x, i, 0));
    ch.push_back(event(x, i, 0));
  }
  for (int i = 1; i <= q; i++) {
    long long v;
    cin >> type;
    if (type == 1) {
      cin >> p >> x;
      p--;
      e.push_back(event(x, p, i));
      ch.push_back(event(x, p, i));
    } else {
      cin >> v;
      c.push_back(make_pair(i, v));
    }
  }
  sort(e.begin(), e.end());
  sort(ch.begin(), ch.end());
  for (int i = 0; i < e.size(); i++) e[i].p = ch[i].p = i;
  key = 2;
  sort(ch.begin(), ch.end());
  m = e.size();
  int j = 0;
  for (int i = 0; i < c.size(); i++) {
    while (j < ch.size() && ch[j].t < c[i].first) {
      if (last[ch[j].id] >= 0) {
        add(last[ch[j].id], m, -val[ch[j].id]);
        Set(last[ch[j].id], 0);
      }
      last[ch[j].id] = ch[j].p;
      val[ch[j].id] = ch[j].val;
      add(last[ch[j].id], m, val[ch[j].id]);
      Set(last[ch[j].id], 1);
      j++;
    }
    int low = 1, high = n + 1;
    while (high - low > 1) {
      int mid = (low + high) / 2;
      int ip = getth(mid);
      if (e[ip].val * (mid - 1) - getSum(ip - 1) >= c[i].second)
        high = mid;
      else
        low = mid;
    }
    int ip = getth(high - 1);
    cout.precision(5);
    cout << fixed << double(getSum(ip) + c[i].second) / (high - 1) << endl;
  }
  return 0;
}