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 = 1 << 29;
const double EPS = 1e-8;
const double PI = acos(-1);
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &t) {
  os << "[";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); ++it) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &t) {
  os << "{";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); ++it) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> &t) {
  return os << "(" << t.first << "," << t.second << ")";
}
template <int N, class Tuple>
void out(ostream &, const Tuple &) {}
template <int N, class Tuple, class, class... Ts>
void out(ostream &os, const Tuple &t) {
  if (N) os << ",";
  os << get<N>(t);
  out<N + 1, Tuple, Ts...>(os, t);
}
template <class... Ts>
ostream &operator<<(ostream &os, const tuple<Ts...> &t) {
  os << "(";
  out<0, tuple<Ts...>, Ts...>(os, t);
  os << ")";
  return os;
}
template <class T>
void output(T *a, int n) {
  for (int i = 0; i < (int)(n); ++i) {
    if (i) cout << ",";
    cout << a[i];
  }
  cout << endl;
}
template <class T>
void output(T *a, int n, int m) {
  for (int i = 0; i < (int)(n); ++i) output(a[i], m);
}
unsigned int xrand() {
  static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
  unsigned int t = x ^ x << 11;
  x = y;
  y = z;
  z = w;
  return w = w ^ w >> 19 ^ t ^ t >> 8;
}
const int MAX = 1000000;
int n, l[MAX], r[MAX], sz[MAX];
long long sm[MAX];
long long val[MAX];
template <class T>
struct Treap {
  int root;
  Treap() : root(-1) {}
  int size(int a) { return ~a ? a[sz] : 0; }
  T sum(int a) { return ~a ? a[sm] : T(); }
  int node(int _l, int _r, T _val) {
    assert(n < MAX);
    n[l] = _l;
    n[r] = _r;
    n[sz] = size(n[l]) + 1 + size(n[r]);
    n[sm] = sum(n[l]) + _val + sum(n[r]);
    n[val] = _val;
    return n++;
  }
  int update(int a, int _l, int _r, T _val) {
    a[l] = _l;
    a[r] = _r;
    a[sz] = size(a[l]) + 1 + size(a[r]);
    a[sm] = sum(a[l]) + _val + sum(a[r]);
    a[val] = _val;
    return a;
  }
  int merge(int a, int b) {
    if (!~a) return b;
    if (!~b) return a;
    if (int(xrand() % (a[sz] + b[sz])) < a[sz])
      return update(a, a[l], merge(a[r], b), a[val]);
    else
      return update(b, merge(a, b[l]), b[r], b[val]);
  }
  int spL, spR;
  void splitAt(int a, int k) {
    if (!~a) {
      spL = spR = -1;
      return;
    }
    if (k <= size(a[l])) {
      splitAt(a[l], k);
      spR = update(a, spR, a[r], a[val]);
    } else {
      splitAt(a[r], k - size(a[l]) - 1);
      spL = update(a, a[l], spL, a[val]);
    }
  }
  void split(int a, T v) {
    if (!~a) {
      spL = spR = -1;
      return;
    }
    if (a[val] >= v) {
      split(a[l], v);
      spR = update(a, spR, a[r], a[val]);
    } else {
      split(a[r], v);
      spL = update(a, a[l], spL, a[val]);
    }
  }
  int build(T *v, int x, int y) {
    if (x == y) return -1;
    int id = x + xrand() % (y - x);
    return node(build(v, x, id), build(v, id + 1, y), v[id]);
  }
  int insertAt(int k, int b) {
    splitAt(root, k);
    return root = merge(merge(spL, b), spR);
  }
  int eraseBetween(int x, int y) {
    splitAt(root, x);
    int t = spL;
    splitAt(spR, y - x);
    return root = merge(t, spR);
  }
  int insert(int a, T v) {
    split(a, v);
    return merge(merge(spL, node(-1, -1, v)), spR);
  }
  int insert(T v) { return root = insert(root, v); }
  int erase(int a, T v) {
    split(a, v);
    int t = spL;
    split(spR, v + 1);
    int t2 = spR;
    splitAt(spL, 1);
    return merge(t, merge(spR, t2));
  }
  int erase(T v) { return root = erase(root, v); }
  T kth(int a, int k) {
    int cnt = size(a[l]);
    if (k == cnt) return a[val];
    if (k < cnt)
      return kth(a[l], k);
    else
      return kth(a[r], k - cnt - 1);
  }
  T kth(int k) {
    if (k >= root[sz]) return 0;
    return kth(root, k);
  }
  int merge2(int dst, int src) {
    if (!~src) return dst;
    dst = merge2(dst, src[l]);
    dst = merge2(dst, src[r]);
    return insert(dst, src[val]);
  }
  void out(int a, ostream &os) const {
    if (!~a)
      os << "*";
    else {
      os << a[val];
      if (~a[l] || ~a[r]) {
        os << "(";
        out(a[l], os);
        os << ",";
        out(a[r], os);
        os << ")";
      }
    }
  }
  pair<long long, int> func(long long v) {
    split(root, v);
    pair<long long, int> ret(sum(spL), size(spL));
    root = merge(spL, spR);
    return ret;
  }
};
template <class T>
ostream &operator<<(ostream &os, const Treap<T> &t) {
  t.out(t.root, os);
  return os;
}
int a[100001];
long long b[100001];
int main() {
  int n, q;
  while (cin >> n >> q) {
    Treap<long long> treap;
    for (int i = 0; i < (int)(n); ++i) {
      scanf("%d", a + i);
      b[i] = a[i];
    }
    sort(b, b + n);
    treap.root = treap.build(b, 0, n);
    for (int i = 0; i < (int)(q); ++i) {
      int t;
      scanf("%d", &t);
      if (t == 1) {
        int p, x;
        scanf("%d%d", &p, &x);
        p--;
        treap.erase(a[p]);
        treap.insert(x);
        a[p] = x;
      } else {
        long long v;
        cin >> v;
        long long low = -1, high = 1000000001;
        double ans = 0;
        while (low + 1 < high) {
          long long mid = low + high >> 1;
          pair<long long, int> p = treap.func(mid);
          if (p.second * mid >= p.first + v) {
            high = mid;
          } else {
            low = mid;
          }
        }
        pair<long long, int> p = treap.func(high);
        ans = (double)(p.first + v) / p.second;
        printf("%.10f\n", ans);
      }
    }
  }
}