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 <typename T>
T in() {
  char ch;
  T n = 0;
  bool ng = false;
  while (1) {
    ch = getchar();
    if (ch == '-') {
      ng = true;
      ch = getchar();
      break;
    }
    if (ch >= '0' && ch <= '9') break;
  }
  while (1) {
    n = n * 10 + (ch - '0');
    ch = getchar();
    if (ch < '0' || ch > '9') break;
  }
  return (ng ? -n : n);
}
template <typename T>
inline T Dis(T x1, T y1, T x2, T y2) {
  return sqrt((x1 - x2 * x1 - x2) + (y1 - y2 * y1 - y2));
}
template <typename T>
inline T POW(T B, T P) {
  if (P == 0) return 1;
  if (P & 1)
    return B * POW(B, P - 1);
  else
    return (POW(B, P / 2) * POW(B, P / 2));
}
template <typename T>
inline T ABS(T a) {
  if (a < 0)
    return -a;
  else
    return a;
}
template <typename T>
inline T Gcd(T a, T b) {
  if (a < 0) return Gcd(-a, b);
  if (b < 0) return Gcd(a, -b);
  return (b == 0) ? a : Gcd(b, a % b);
}
template <typename T>
inline T Lcm(T a, T b) {
  if (a < 0) return Lcm(-a, b);
  if (b < 0) return Lcm(a, -b);
  return a * (b / Gcd(a, b));
}
long long Bigmod(long long base, long long power, long long MOD) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
long long ModInverse(long long number, long long MOD) {
  return Bigmod(number, MOD - 2, MOD);
}
int Set(int N, int pos) { return N = N | (1 << pos); }
int Reset(int N, int pos) { return N = N & ~(1 << pos); }
bool Chkbit(int N, int pos) { return (bool)(N & (1 << pos)); }
bool isVowel(char ch) {
  ch = toupper(ch);
  if (ch == 'A' || ch == 'U' || ch == 'I' || ch == 'O' || ch == 'E')
    return true;
  return false;
}
bool isConst(char ch) {
  if (isalpha(ch) && !isVowel(ch)) return true;
  return false;
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
long long int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int n, m;
long long int ar[1000007];
struct z {
  int id, p;
  long long int val;
  z() {}
  z(int _, int __, long long int ___) {
    id = _, p = __;
    val = ___;
  }
};
z Ar[1000007];
map<long long int, int> mp, mp1;
vector<long long int> v;
long long int Tree[1000007];
long long int Tree1[1000007];
int MxVal;
void Update(int id, long long int Val) {
  while (id <= MxVal) {
    Tree[id] += Val;
    id += id & -id;
  }
}
void Update1(int id, int val) {
  while (id <= MxVal) {
    Tree1[id] += val;
    id += id & -id;
  }
}
long long int Query(int id) {
  long long int ans = 0;
  while (id > 0) {
    ans += Tree[id];
    id -= id & -id;
  }
  return ans;
}
int Query1(int id) {
  int ans = 0;
  while (id > 0) {
    ans += Tree1[id];
    id -= id & -id;
  }
  return ans;
}
int Check(double a, double b) {
  if (a - b > 1e-4) return 1;
  return 0;
}
int FindId1(long long int val) {
  long long int Id =
      lower_bound(v.begin(), v.end(), (long long int)val) - v.begin();
  Id++;
  return Id;
}
int FindId(long long int val) {
  long long int Id =
      lower_bound(v.begin(), v.end(), (long long int)val) - v.begin();
  if (mp1[val] == 0)
    ;
  else
    Id++;
  return Id;
}
double FinD(double val) {
  long long int Id = FindId((long long int)val);
  long long int Sum = Query(Id);
  Id = Query1(Id);
  double Tot = (1.0 * Id * val) - Sum;
  return Tot;
}
double solve(double val) {
  double l = 0.0, h = 500000000000000000 * 1.0, mid;
  double ans = -1.0;
  while (Check(h, l)) {
    double mid = (l + h) / 2.0;
    double An = FinD(mid);
    if (An >= val) {
      ans = mid;
      h = mid;
    } else {
      l = mid;
    }
  }
  return ans;
}
int main() {
  n = in<int>(), m = in<int>();
  for (int i = 1; i < n + 1; i++) {
    ar[i] = in<long long int>();
    if (mp[ar[i]] == 0) {
      mp[ar[i]] = 1;
    }
  }
  for (int i = 1; i < m + 1; i++) {
    int id;
    id = in<int>();
    int p = -1;
    long long int val;
    if (id == 1) {
      p = in<int>();
      val = in<long long int>();
    } else {
      val = in<long long int>();
    }
    mp[val] = 1;
    Ar[i] = z(id, p, val);
  }
  map<long long int, int>::iterator it;
  for (it = mp.begin(); it != mp.end(); it++) {
    v.push_back(it->first);
    mp1[v[v.size() - 1]] = 1;
  }
  MxVal = 2 * v.size();
  long long int sm = 0;
  for (int i = 1; i < n + 1; i++) {
    int Id = lower_bound(v.begin(), v.end(), ar[i]) - v.begin();
    Id++;
    Update(Id, ar[i]);
    Update1(Id, 1);
    sm += ar[i];
  }
  for (int i = 1; i < m + 1; i++) {
    int id, p;
    long long int val;
    id = Ar[i].id, p = Ar[i].p, val = Ar[i].val;
    if (id == 1) {
      int Id = FindId1(ar[p]);
      long long int diff = -ar[p];
      Update(Id, diff);
      Update1(Id, -1);
      Id = FindId1(val);
      Update1(Id, 1);
      Update(Id, val);
      ar[p] = val;
    } else {
      double ans = solve(val * 1.0);
      printf("%.6lf\n", ans);
    }
  }
  return 0;
}