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;
struct node {
  int v, size, priority;
  long long sum;
  node *left, *right, *parent;
} * root, *nilT;
void setlink(node *x, node *y, bool inleft) {
  y->parent = x;
  if (inleft)
    x->left = y;
  else
    x->right = y;
}
node *new_node(int v) {
  node *p = new node;
  p->v = v;
  p->size = 1;
  p->sum = v;
  p->priority = rand();
  p->left = p->right = p->parent = nilT;
  return p;
}
void update(node *x) {
  x->sum = x->left->sum + x->right->sum + x->v;
  x->size = x->left->size + x->right->size + 1;
}
void uptree(node *x) {
  node *y = x->parent;
  if (y == nilT) return;
  node *z = y->parent;
  if (x == y->left) {
    setlink(y, x->right, 1);
    setlink(x, y, 0);
  } else {
    setlink(y, x->left, 0);
    setlink(x, y, 1);
  }
  setlink(z, x, y == z->left);
  if (y == root) root = x;
  update(y);
  update(x);
}
void add(int v) {
  if (root == nilT) {
    root = new_node(v);
    return;
  }
  node *x = root, *y = nilT;
  while (x != nilT) {
    y = x;
    if (v < y->v)
      x = x->left;
    else
      x = x->right;
  }
  x = new_node(v);
  setlink(y, x, v < y->v);
  while (y != nilT) {
    y->size++;
    y->sum += v;
    y = y->parent;
  }
  while (x->parent != nilT && x->parent->priority < x->priority) uptree(x);
}
void del(int v) {
  node *x = root;
  while (x != nilT && x->v != v) {
    if (v < x->v)
      x = x->left;
    else
      x = x->right;
  }
  if (x == nilT) return;
  while (x->left != nilT && x->right != nilT) {
    if (x->left->priority > x->right->priority)
      uptree(x->left);
    else
      uptree(x->right);
  }
  node *y = x->parent;
  node *z;
  if (x->left != nilT)
    z = x->left;
  else
    z = x->right;
  setlink(y, z, x == y->left);
  if (x == root) root = z;
  while (y != nilT) {
    y->size--;
    y->sum -= v;
    y = y->parent;
  }
  delete x;
}
void init() {
  nilT = new node;
  nilT->sum = nilT->size = 0;
  nilT->priority = 0;
  root = nilT;
}
int n, q, a[111111];
double cal(long long v) {
  node *p = root;
  long long sum_left = 0, cnt_left = 0;
  int pos = n + 1;
  while (p != nilT) {
    if (1ll * p->v * (p->left->size + cnt_left) - (p->left->sum + sum_left) >
        v) {
      pos = cnt_left + p->left->size + 1;
      p = p->left;
    } else {
      sum_left += p->left->sum + p->v;
      cnt_left += p->left->size + 1;
      p = p->right;
    }
  }
  sum_left = 0, cnt_left = 0;
  p = root;
  while (p != nilT) {
    if (p->left->size + cnt_left + 1 == pos - 1) {
      long long k = v - (1ll * p->v * (p->left->size + cnt_left) -
                         (p->left->sum + sum_left));
      return p->v + 1.0 * k / (pos - 1);
    } else if (p->left->size + cnt_left + 1 < pos - 1) {
      cnt_left += p->left->size + 1;
      sum_left += p->left->sum + p->v;
      p = p->right;
    } else
      p = p->left;
  }
  return -1;
}
int main() {
  init();
  scanf("%d%d", &n, &q);
  for (int i = 1, _c = n; i <= _c; i++) {
    scanf("%d", &a[i]);
    add(a[i]);
  }
  int t, p, x;
  long long v;
  for (int i = 0, _a = (q); i < _a; ++i) {
    scanf("%d", &t);
    if (t == 1) {
      scanf("%d%d", &p, &x);
      del(a[p]);
      a[p] = x;
      add(x);
    } else {
      scanf("%I64d", &v);
      printf("%0.9lf\n", cal(v));
    }
  }
  return 0;
}