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;
template <class T>
T Maximize(T &v, T nv) {
  if (nv > v) v = nv;
  return v;
}
template <class T>
T Minimize(T &v, T nv) {
  if (nv < v) v = nv;
  return v;
}
template <class T>
T Mod(T &v, T mod) {
  return v = (v % mod + mod) % mod;
}
const long long INFLL = numeric_limits<long long>::max();
const long INF = numeric_limits<long>::max(), N = (long)1e5 + 1;
struct Res {
  long n;
  long long h, sum;
  Res(long n, long long h, long long sum) : n(n), h(h), sum(sum) {}
};
class Treap {
  struct Node {
    long pr, size;
    long long sum;
    long long key;
    Node *l, *r;
    Node(long long key) : size(1), sum(key), key(key), l(0), r(0) {}
    Node(long long key, Node *l, Node *r)
        : size(1), sum(key), key(key), l(l), r(r) {
      pr = (rand() << 15) + rand();
    }
    void Print() {
      printf("%ld", key);
      printf("(%ld) ", size);
    }
  };

 private:
  Node *root;
  void erase(Node *&v, long key) {
    if (v->key == key)
      Merge(v->l, v->r, v);
    else
      erase(key < v->key ? v->l : v->r, key);
    Update(v);
  }

 public:
  Treap() { root = NULL; }
  long SizeOf(Node *v) { return v ? v->size : 0; }
  long long SumOf(Node *v) { return v ? v->sum : 0; }
  void Update(Node *v) {
    if (!v) return;
    v->sum = SumOf(v->l) + SumOf(v->r) + v->key;
    v->size = SizeOf(v->l) + SizeOf(v->r) + 1;
  }
  void Split(Node *v, long long key, Node *&l, Node *&r) {
    if (!v) return void(r = l = 0);
    if (v->key <= key) {
      Split(v->r, key, v->r, r);
      l = v;
    } else {
      Split(v->l, key, l, v->l);
      r = v;
    }
    Update(v);
  }
  void Merge(Node *l, Node *r, Node *&v) {
    if (!l || !r) return void(v = l ? l : r);
    if (l->pr > r->pr) {
      v = l;
      Merge(l->r, r, v->r);
    } else {
      v = r;
      Merge(l, r->l, v->l);
    }
    Update(v);
  }
  void Insert(long long key) {
    Node *l = 0, *r = 0;
    Split(root, key, l, r);
    Node *x = new Node(key);
    Merge(l, x, l);
    Merge(l, r, root);
  }
  void Erase(long long key) { erase(root, key); }
  Res LowerThanSum(double key) {
    Node *v = root;
    long less = 0;
    long long sum = 0;
    while (v) {
      if (key < v->key) {
        v = v->l;
      } else if (key >= v->key) {
        less += SizeOf(v->l) + 1;
        sum += SumOf(v->l) + v->key;
        v = v->r;
      } else {
        break;
      }
    }
    return Res(less, 42, sum);
  }
  void Print(Node *v) {
    if (!v) return;
    Print(v->l);
    v->Print();
    Print(v->r);
  }
  void Print() {
    Print(root);
    printf("\n");
  }
};
long n, a[N];
void solve() {
  srand(time(0));
  long q;
  scanf("%ld %ld", &n, &q);
  Treap *t = new Treap();
  for (long i = 0; i < n; ++i) {
    scanf("%ld", a + i);
    t->Insert(a[i]);
  }
  while (q--) {
    long op;
    scanf("%ld", &op);
    switch (op) {
      case 1:
        long i, x;
        scanf("%ld %ld", &i, &x);
        t->Erase(a[i - 1]);
        t->Insert(x);
        a[i - 1] = x;
        break;
      case 2:
        long long v;
        scanf("%I64d", &v);
        double res, l = .0, r = 1e15 + 1e10, m;
        for (long steps = 0; steps < 65; ++steps) {
          m = (l + r) / 2;
          Res res = t->LowerThanSum(m);
          if (m * res.n - res.sum > v) {
            r = m;
          } else {
            l = m;
          }
        }
        printf("%lf\n", m);
        break;
    }
  }
}
void init() {}
int main() {
  init();
  solve();
  return 0;
}