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 getint() {
  int s = 0, o = 1;
  char c;
  for (c = getchar(); c < '0' || c > '9'; c = getchar())
    if (c == '-') o = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) s *= 10, s += c - '0';
  return s * o;
}
const int maxn = 100010 * 2;
struct node {
  node *f, *c[2];
  int x, s, mx;
  long long xx;
  bool d() { return f->c[1] == this; }
  void up() {
    s = c[0]->s + c[1]->s + 1;
    xx = c[0]->xx + c[1]->xx + x;
    mx = max(x, c[1]->mx);
  }
  void put(node *p, bool o) { c[o] = p, p->f = this; }
  void rot() {
    bool o = d();
    node *F = f;
    F->f->put(this, f->d());
    F->put(c[!o], o);
    put(F, !o);
    F->up(), up();
  }
  void splay(node *);
  void ts();
} mem[maxn], *null = &mem[0], *C = &mem[1];
void node::ts() {
  if (this != null) {
    c[0]->ts();
    printf("X %d S %d XX %I64d\n", x, s, xx);
    c[1]->ts();
  }
}
void node::splay(node *goal = null) {
  while (f != goal) {
    if (f->f == goal)
      rot();
    else {
      (d() == f->d()) ? (f->rot(), rot()) : (rot(), rot());
    }
  }
}
node *newnode(int _x) {
  C->x = _x, C->c[0] = C->c[1] = C->f = null, C->s = 1;
  return C++;
}
node *root = null;
node *ins(node *r, int x) {
  node *p = newnode(x);
  if (r == null) return p;
  for (; r;) {
    int o = x > r->x;
    if (r->c[o] == null) {
      r->put(p, o);
      break;
    } else
      r = r->c[o];
  }
  p->splay(null);
  return p;
}
node *del(node *r, int x) {
  node *p = r, *q;
  for (; p->x != x;) p = p->c[x > p->x];
  p->splay(null);
  q = p->c[0];
  if (q == null) {
    q = p->c[1];
    q->f = null;
    return q;
  }
  for (; q->c[1] != null; q = q->c[1])
    ;
  q->splay(p);
  q->put(p->c[1], 1);
  q->f = null;
  q->up();
  return q;
}
int n, m, x, y;
int a[maxn];
int main(int argc, char const *argv[]) {
  n = getint(), m = getint();
  for (int i = 0; i < n; i++) {
    a[i] = getint();
    root = ins(root, a[i]);
  }
  for (int mm = 0; mm < m; mm++) {
    int o = getint();
    if (o == 1) {
      x = getint(), y = getint();
      x--;
      root = del(root, a[x]);
      root = ins(root, a[x] = y);
    } else {
      long long v;
      scanf("%I64d", &v);
      long long xx = 0, s = 0;
      double r = 1e18, rr;
      node *tmp;
      int nn = n;
      for (node *p = root; p != null;) {
        tmp = p;
        rr = (v + p->c[0]->xx + xx + p->x) * 1.0 / (s + p->c[0]->s + 1);
        if (rr >= p->x) {
          r = min(r, rr);
          xx = p->c[0]->xx + xx + p->x;
          s = s + p->c[0]->s + 1;
          p = p->c[1];
        } else {
          p = p->c[0];
        }
      }
      if (tmp != null) {
        tmp->splay(null);
        root = tmp;
      }
      printf("%.10lf\n", r);
    }
  }
  return 0;
}