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 inf = 0x3f3f3f3f;
const long long infLL = 0x3f3f3f3f3f3f3f3fLL;
class SBT {
  struct Node {
    int val, sz;
    long long sum;
    Node *c[2];
    Node(int v, int s, Node *p) : val(v), sz(s), sum(v) { c[0] = c[1] = p; }
    void rz() {
      sz = c[0]->sz + c[1]->sz + 1;
      sum = c[0]->sum + c[1]->sum + val;
    }
  } * root, *null;
  void clear(Node *t) {
    if (t == null) return;
    clear(t->c[0]);
    clear(t->c[1]);
    delete t;
  }
  void rotate(Node *&t, bool d) {
    Node *p = t->c[d];
    t->c[d] = p->c[!d];
    p->c[!d] = t;
    t->rz();
    p->rz();
    t = p;
  }
  void maintain(Node *&t, bool d) {
    if (t == null) return;
    Node *&p = t->c[d];
    if (p->c[d]->sz > t->c[!d]->sz) {
      rotate(t, d);
    } else if (p->c[!d]->sz > t->c[!d]->sz) {
      rotate(p, !d);
      rotate(t, d);
    } else {
      return;
    }
    maintain(t->c[0], 0);
    maintain(t->c[1], 1);
    maintain(t, 0);
    maintain(t, 1);
  }
  void insert(Node *&t, int x) {
    if (t == null) {
      t = new Node(x, 1, null);
      return;
    }
    bool d = x > t->val;
    insert(t->c[d], x);
    maintain(t, d);
    t->rz();
  }
  void erase(Node *&t, int x) {
    if (t == null) return;
    if (t->val == x) {
      if (t->c[1] == null) {
        delete t;
        t = t->c[0];
        return;
      }
      if (t->c[0] == null) {
        delete t;
        t = t->c[1];
        return;
      }
      Node *p = t->c[1];
      while (p->c[0] != null) p = p->c[0];
      t->val = p->val;
      erase(t->c[1], p->val);
      maintain(t, 0);
    } else {
      bool d = x > t->val;
      erase(t->c[d], x);
      maintain(t, !d);
    }
    t->rz();
  }
  int select(Node *t, int k) {
    int r = t->c[0]->sz;
    if (k == r) return t->val;
    if (k < r) return select(t->c[0], k);
    return select(t->c[1], k - r - 1);
  }
  int rank(Node *t, int x) {
    if (t == null) return 0;
    int r = t->c[0]->sz;
    if (x == t->val) return r;
    if (x < t->val) return rank(t->c[0], x);
    return r + 1 + rank(t->c[1], x);
  }

 public:
  SBT() {
    null = new Node(0, 0, 0);
    null->c[0] = null->c[1] = null;
    root = null;
  }
  ~SBT() {
    clear(root);
    delete null;
  }
  void clear() {
    clear(root);
    root = null;
  }
  bool empty() { return root == null; }
  int size() { return root->sz; }
  void insert(int x) { insert(root, x); }
  void erase(int x) { erase(root, x); }
  int select(int k) {
    if (k < 1) return -inf;
    if (k > root->sz) return inf;
    return select(root, k - 1);
  }
  int rank(int x) { return rank(root, x) + 1; }
  double find(Node *u, long long v, int psz, long long psum) {
    if ((long long)u->val * (psz + u->c[0]->sz) >= psum + u->c[0]->sum + v) {
      if (u->c[0] != null) {
        double t = find(u->c[0], v, psz, psum);
        if (t > -1) return t;
      }
      return ((double)v + psum + u->c[0]->sum) / (psz + u->c[0]->sz);
    }
    if (u->c[1] == null) return -1;
    return find(u->c[1], v, psz + u->c[0]->sz + 1,
                psum + u->c[0]->sum + u->val);
  }
  double solve(long long v) {
    double res = find(root, v, 0, 0);
    if (res < 0)
      return ((double)v + root->sum) / root->sz;
    else
      return res;
  }
} tree;
const int maxn = 100000 + 5;
int n, q;
int h[maxn];
int main() {
  cin >> n >> q;
  for (int i = 0; i < (n); ++i) {
    cin >> h[i];
    tree.insert(h[i]);
  }
  while (q--) {
    int op, p, x;
    long long v;
    cin >> op;
    if (op == 1) {
      cin >> p >> x;
      --p;
      tree.erase(h[p]);
      tree.insert(h[p] = x);
    } else {
      cin >> v;
      cout << fixed << setprecision(5) << tree.solve(v) << endl;
    }
  }
  return 0;
}