#include <bits/stdc++.h>
namespace IO {
int double_len(6);
bool spacebar_can_see(1);
const char NUMBER_TO_CHAR[36] = {
    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70, 71, 72,
    73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90};
const int CHAR_TO_NUMBER[128] = {
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  2,  3,  4,  5,  6,  7,  8,
    9,  0,  0,  0,  0,  0,  0,  0,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
    21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 0,  0,  0,  0,
    0,  0,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
    27, 28, 29, 30, 31, 32, 33, 34, 35, 0,  0,  0,  0,  0};
template <typename T>
class Number {
 public:
  unsigned int len;
  int hex;
  T number;
  inline Number(const T number = 0, const int hex = 10, const int len = 0)
      : number(number), hex(hex), len(len) {}
  inline operator T() const { return number; }
  inline Number<T> &operator=(const T &a) {
    number = a;
    return *this;
  }
};
inline bool CanSee(const char ch) {
  return spacebar_can_see ? (31 < ch && ch < 127) : (32 < ch && ch < 127);
}
inline bool IsNumber(const char ch) { return (47 < ch && ch < 58); }
inline bool IsNumber_(const int hex, const char ch) {
  return (47 < ch && ch < 48 + hex) || (64 < ch && ch < 55 + hex) ||
         (96 < ch && ch < 87 + hex);
}
const int IN_BUF = 1 << 23, OUT_BUF = 1 << 23;
char buf[IN_BUF], *ps = buf, *pt = buf, pbuf[OUT_BUF], *pp = pbuf;
inline char GetChar() {
  if (ps == pt) {
    ps = buf;
    pt = buf + fread(buf, 1, IN_BUF, stdin);
  }
  return ps == pt ? EOF : *ps++;
}
inline void PutChar(const char ch) {
  if (pp == pbuf + OUT_BUF) {
    fwrite(pbuf, 1, OUT_BUF, stdout);
    pp = pbuf;
  }
  *pp++ = ch;
}
char read_ch(10);
template <class T>
inline T ReadInt() {
  register T x(0);
  register bool f(1);
  while (!IsNumber(read_ch) && (~read_ch)) {
    if (read_ch == 45) {
      f = 0;
    }
    read_ch = GetChar();
  }
  while (IsNumber(read_ch) && (~read_ch)) {
    x = (x << 1) + (x << 3) + (read_ch ^ 48);
    read_ch = GetChar();
  }
  return f ? x : -x;
}
template <class T>
inline T ReadUInt() {
  register T x(0);
  while (!IsNumber(read_ch) && (~read_ch)) {
    read_ch = GetChar();
  }
  while (IsNumber(read_ch) && (~read_ch)) {
    x = (x << 1) + (x << 3) + (read_ch ^ 48);
    read_ch = GetChar();
  }
  return x;
}
template <class T>
inline T ReadKInt(const int hex) {
  register T x(0);
  register bool f(1);
  while (!IsNumber_(hex, read_ch) && (~read_ch)) {
    if (read_ch == 45) {
      f = 0;
    }
    read_ch = GetChar();
  }
  while (IsNumber_(hex, read_ch) && (~read_ch)) {
    x = x * hex + CHAR_TO_NUMBER[read_ch];
    read_ch = GetChar();
  }
  return f ? x : -x;
}
template <class T>
inline T ReadUKInt(const int hex) {
  register T x(0);
  while (!IsNumber_(hex, read_ch) && (~read_ch)) {
    read_ch = GetChar();
  }
  while (IsNumber_(hex, read_ch) && (~read_ch)) {
    x = x * hex + CHAR_TO_NUMBER[read_ch];
    read_ch = GetChar();
  }
  return x;
}
inline double ReadDouble() {
  register long long int_num(ReadInt<long long>());
  if (read_ch == 46) {
    register double pow10(1.0), result(0);
    read_ch = GetChar();
    while (IsNumber(read_ch) && (~read_ch)) {
      pow10 /= 10.0;
      result += pow10 * (read_ch ^ 48);
      read_ch = GetChar();
    }
    return int_num + (int_num < 0 ? -result : result);
  } else {
    return (double)int_num;
  }
}
inline void ReadT(int &x) { x = ReadInt<int>(); }
inline void ReadT(long long &x) { x = ReadInt<long long>(); }
inline void ReadT(bool &x) { x = ReadUInt<bool>(); }
inline void ReadT(unsigned int &x) { x = ReadUInt<unsigned int>(); }
inline void ReadT(unsigned long long &x) { x = ReadUInt<unsigned long long>(); }
inline void ReadT(double &x) { x = ReadDouble(); }
inline void ReadT(char &ch) {
  for (; !CanSee(read_ch) && (~read_ch); read_ch = GetChar())
    ;
  ch = read_ch;
  read_ch = 10;
}
inline void ReadT(Number<int> &x) { x.number = ReadKInt<int>(x.hex); }
inline void ReadT(Number<long long> &x) {
  x.number = ReadKInt<long long>(x.hex);
}
inline void ReadT(Number<unsigned int> &x) {
  x.number = ReadUKInt<unsigned int>(x.hex);
}
inline void ReadT(Number<unsigned long long> &x) {
  x.number = ReadUKInt<unsigned long long>(x.hex);
}
inline void ReadT(char *s) {
  register int len(0);
  for (; !CanSee(read_ch) && (~read_ch); read_ch = GetChar())
    ;
  for (; CanSee(read_ch) && (~read_ch); read_ch = GetChar()) {
    s[len++] = read_ch;
  }
  s[len] = 0;
  read_ch = 10;
}
template <class T>
inline void Read(T &t) {
  ReadT(t);
}
template <class T, class... Args>
void Read(T &t, Args &...args) {
  ReadT(t);
  Read(args...);
}
template <class T>
inline void WriteUInt(T x) {
  static char out_number[25];
  static int cnt;
  out_number[cnt = 1] = x % 10 ^ 48;
  while (x /= 10) {
    out_number[++cnt] = x % 10 ^ 48;
  }
  while (cnt) {
    PutChar(out_number[cnt--]);
  }
}
template <class T>
inline void WriteInt(const T x) {
  if (x < 0) {
    PutChar(45);
    WriteUInt(-x);
    return;
  }
  WriteUInt(x);
}
template <class T>
inline void WriteUKInt(T x, const int hex, int len) {
  static char out_number[25];
  static int cnt;
  out_number[cnt = 1] = NUMBER_TO_CHAR[x % hex];
  while (x /= hex) {
    out_number[++cnt] = NUMBER_TO_CHAR[x % hex];
  }
  len -= cnt;
  while (0 < len--) {
    PutChar(48);
  }
  while (cnt) {
    PutChar(out_number[cnt--]);
  }
}
template <class T>
inline void WriteKInt(const T x, const int hex, const int len) {
  if (x < 0) {
    PutChar(45);
    WriteUKInt(-x, hex, len - 1);
    return;
  }
  WriteUKInt(x, hex, len);
}
inline void WriteDouble(double x, int len) {
  if (x < 0) {
    PutChar(45);
    x = -x;
  }
  WriteUInt<unsigned long long>((unsigned long long)x);
  if (len) {
    x -= (int)x;
    PutChar(46);
    while (len--) {
      x *= 10;
      if (!(unsigned long long)x) {
        PutChar(48);
      }
    }
    if ((unsigned long long)x) {
      WriteUInt<unsigned long long>((unsigned long long)x);
    }
  }
}
inline void WriteT(const int x) { WriteInt<int>(x); }
inline void WriteT(const long long x) { WriteInt<long long>(x); }
inline void WriteT(const bool x) { PutChar(x | 48); }
inline void WriteT(const unsigned int x) { WriteUInt<unsigned int>(x); }
inline void WriteT(const unsigned long long x) {
  WriteUInt<unsigned long long>(x);
}
inline void WriteT(const double x) { WriteDouble(x, double_len); }
inline void WriteT(const char *s) {
  while (*s) {
    PutChar(*s++);
  }
}
inline void WriteT(const char x) { PutChar(x); }
inline void WriteT(const Number<int> x) { WriteKInt(x.number, x.hex, x.len); }
inline void WriteT(const Number<long long> x) {
  WriteKInt(x.number, x.hex, x.len);
}
inline void WriteT(const Number<unsigned int> x) {
  WriteUKInt(x.number, x.hex, x.len);
}
inline void WriteT(const Number<unsigned long long> x) {
  WriteUKInt(x.number, x.hex, x.len);
}
template <class T>
inline void Write(const T t) {
  WriteT(t);
}
template <class T, class... Args>
void Write(const T t, const Args... args) {
  WriteT(t);
  Write(args...);
}
inline void Writeln() { PutChar(10); }
template <class T>
inline void Writeln(const T t) {
  WriteT(t);
  PutChar(10);
}
template <class... Args>
inline void Writeln(const Args... args) {
  Write(args...);
  PutChar(10);
}
template <class... Args>
inline void WriteExit(const Args... args) {
  Write(args...);
  PutChar(10);
  exit(0);
}
template <class... Args>
inline void DeBug(const Args... args) {}
template <class... Args>
inline void DeBugln(const Args... args) {}
inline void DeBugln() {}
class CodeToDo {
 public:
  inline CodeToDo() { srand(time(0)); }
  inline ~CodeToDo() {
    double_len = 3;
    DeBugln("\nTime=", (double)clock() / CLOCKS_PER_SEC, "s");
    fwrite(pbuf, 1, pp - pbuf, stdout);
  }
} code_to_do;
}  // namespace IO
using namespace IO;
using namespace std;
template <typename T>
inline T Max(const T a, const T b) {
  return a < b ? b : a;
}
template <typename T, typename... Args>
T Max(const T a, const Args... args) {
  return Max(a, Max(args...));
}
template <typename T>
inline T Min(const T a, const T b) {
  return a < b ? a : b;
}
template <typename T, typename... Args>
T Min(const T a, const Args... args) {
  return Min(a, Min(args...));
}
template <typename T>
inline void Swap(T &a, T &b) {
  register T temp = a;
  a = b;
  b = temp;
}
const int MAXN = 1e5 + 5;
int n, m;
int arr[MAXN];
int root = 0;
namespace SGT {
class SegmentTree {
 public:
  int lson, rson;
  int sum;
  long long sum_;
} sgt[MAXN * 32];
int sgt_cnt = 0;
inline void PushUp(const int now) {
  sgt[now].sum = sgt[sgt[now].lson].sum + sgt[sgt[now].rson].sum;
  sgt[now].sum_ = sgt[sgt[now].lson].sum_ + sgt[sgt[now].rson].sum_;
}
void Updata(const int val, const int add, int &now, const int left = 0,
            const int right = 1000000000) {
  if (val < left || right < val) {
    return;
  }
  if (!now) {
    now = ++sgt_cnt;
  }
  if (left == right) {
    sgt[now].sum += add;
    sgt[now].sum_ += add * val;
    return;
  }
  Updata(val, add, sgt[now].lson, left, ((left + right) >> 1));
  Updata(val, add, sgt[now].rson, ((left + right) >> 1) + 1, right);
  PushUp(now);
}
double Query(const long long val, const int now, const int left = 0,
             const int right = 1000000000, const long long sum = 0,
             const long long sum_ = 0) {
  if (left == right) {
    return (val + sgt[now].sum_ + sum_) * 1.0 / (sgt[now].sum + sum);
  }
  if (sum_ + sgt[sgt[now].lson].sum_ + val <
      1ll * (sum + sgt[sgt[now].lson].sum) * (((left + right) >> 1) + 1)) {
    return Query(val, sgt[now].lson, left, ((left + right) >> 1), sum, sum_);
  }
  return Query(val, sgt[now].rson, ((left + right) >> 1) + 1, right,
               sum + sgt[sgt[now].lson].sum, sum_ + sgt[sgt[now].lson].sum_);
}
}  // namespace SGT
int main() {
  Read(n, m);
  for (register int i = (1); i <= (n); ++i) {
    Read(arr[i]);
    SGT::Updata(arr[i], 1, root);
  }
  int opt, p, x;
  long long ml;
  for (register int i = (1); i <= (m); ++i) {
    Read(opt);
    if (opt == 1) {
      Read(p, x);
      SGT::Updata(arr[p], -1, root);
      arr[p] = x;
      SGT::Updata(arr[p], 1, root);
    }
    if (opt == 2) {
      Read(ml);
      Writeln(SGT::Query(ml, root));
    }
  }
  return 0;
}
