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 max_n = 1e5 + 1;
int n, q;
int a[max_n];
struct treap {
  treap* left;
  treap* right;
  int prior;
  int key;
  long long sum;
  int cnt;
  treap(int _key)
      : left(NULL), right(NULL), prior(rand()), key(_key), sum(_key), cnt(1) {}
};
typedef treap* ptreap;
ptreap root;
inline int get_cnt(ptreap T) { return (T == NULL ? 0 : T->cnt); }
inline long long get_sum(ptreap T) { return (T == NULL ? 0 : T->sum); }
inline ptreap get_left(ptreap T) { return (T == NULL ? NULL : T->left); }
inline ptreap get_right(ptreap T) { return (T == NULL ? NULL : T->right); }
void update_values(ptreap& T) {
  if (T != NULL) {
    T->sum = T->key + get_sum(T->left) + get_sum(T->right);
    T->cnt = 1 + get_cnt(T->left) + get_cnt(T->right);
  }
}
void split(ptreap T, ptreap& L, ptreap& R, int key) {
  if (T == NULL) {
    L = R = NULL;
  } else {
    if (T->key <= key) {
      L = T;
      split(T->right, L->right, R, key);
      update_values(L);
    } else {
      R = T;
      split(T->left, L, R->left, key);
      update_values(R);
    }
  }
}
ptreap merge(ptreap L, ptreap R) {
  if (L == NULL) return R;
  if (R == NULL) return L;
  if (L->prior >= R->prior) {
    L->right = merge(L->right, R);
    update_values(L);
    return L;
  } else {
    R->left = merge(L, R->left);
    update_values(R);
    return R;
  }
}
void tadd(ptreap& T, int key) {
  ptreap L, R;
  split(T, L, R, key);
  ptreap M = new treap(key);
  T = merge(L, merge(M, R));
}
void tdel(ptreap& T, int key) {
  ptreap L, M, R;
  split(T, L, R, key);
  split(L, L, M, key - 1);
  M = merge(get_left(M), get_right(M));
  T = merge(L, merge(M, R));
}
int get_kth(ptreap T, int k) {
  if (get_cnt(T->left) >= k) return get_kth(T->left, k);
  if (get_cnt(T->left) + 1 == k) {
    return T->key;
  }
  return get_kth(T->right, k - (get_cnt(T->left) + 1));
}
long long get_sum_kth(ptreap T, int k) {
  if (get_cnt(T->left) >= k) {
    return get_sum_kth(T->left, k);
  }
  long long res = get_sum(T->left) + T->key;
  if (k > 1 + get_cnt(T->left)) {
    res += get_sum_kth(T->right, k - (get_cnt(T->left) + 1));
  }
  return res;
}
bool check_condition(long long sum, int cnt, int val, long long v) {
  return 1LL * val * cnt - sum <= v;
}
double get_ans(long long v) {
  int lo = 1;
  int hi = n;
  int k = 1;
  while (lo <= hi) {
    int mi = (lo + hi) >> 1;
    if (check_condition(get_sum_kth(root, mi), mi, get_kth(root, mi), v)) {
      k = mi;
      lo = mi + 1;
    } else {
      hi = mi - 1;
    }
  }
  v += get_sum_kth(root, k);
  return 1.0 * v / k;
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  root = NULL;
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    tadd(root, a[i]);
  }
  cout << fixed << setprecision(4);
  for (int i = 0; i < q; ++i) {
    int tp;
    cin >> tp;
    if (tp == 1) {
      int p, x;
      cin >> p >> x;
      --p;
      tdel(root, a[p]);
      a[p] = x;
      tadd(root, a[p]);
    } else {
      long long v;
      cin >> v;
      cout << get_ans(v) << '\n';
    }
  }
  cout.flush();
  return 0;
}