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 JAVA):

Solution:
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int q = in.nextInt();
		Treap treap = null;
		int[] h = new int[n];
		for (int i = 0; i < n; i++) {
			h[i] = in.nextInt();
		}
		int[] hs = h.clone();
		Arrays.sort(hs);
		for (int i = 0; i < n; i++) {
			treap = insert(treap, i, hs[i]);
		}
		for (int i = 0; i < q; i++) {
			int t = in.nextInt();
			if (t == 1) {
				int p = in.nextInt() - 1;
				int x = in.nextInt();
				int pos1 = find(treap, h[p], 0);
				treap = remove(treap, pos1);
				int pos2 = find(treap, x, 0);
				treap = insert(treap, pos2, x);
				h[p] = x;
			} else {
				long v = Long.parseLong(in.next());
				res = Double.POSITIVE_INFINITY;
				dfs(treap, v, 0, 0);
				out.printf("%.5f\n", res);
			}
		}
	}

	static double res;

	static int find(Treap root, int value, int cnt) {
		if (root == null) {
			return cnt;
		}
		pushDelta(root);
		if (value < root.nodeValue) {
			return find(root.left, value, cnt);
		} else if (value > root.nodeValue) {
			return find(root.right, value, cnt + 1 + getCount(root.left));
		} else {
			return cnt + getCount(root.left);
		}
	}

	static void dfs(Treap root, long v, int cnt, long sum) {
		if (root == null)
			return;
		pushDelta(root);
		int totalCount = getCount(root.left) + cnt + 1;
		long totalSum = getSubTreeValue(root.left) + sum + root.nodeValue;
		double level = (double) (totalSum + v) / totalCount;
		res = Math.min(res, level);
		if (totalSum + v <= (long) root.nodeValue * totalCount) {
			dfs(root.left, v, cnt, sum);
		} else {
			dfs(root.right, v, totalCount, totalSum);
		}
	}

	// Modify the following 5 methods to implement your custom operations on the tree.
	// This example implements Add/Max operations. Operations like Add/Sum, Set/Max can also be implemented.
	static long modifyOperation(long x, long y) {
		return x + y;
	}

	// query (or combine) operation
	static long queryOperation(long leftValue, long rightValue) {
		return leftValue + rightValue;
	}

	static long deltaEffectOnSegment(long delta, int segmentLength) {
		// Here you must write a fast equivalent of following slow code:
		// int result = delta;
		// for (int i = 1; i < segmentLength; i++) result = queryOperation(result, delta);
		// return result;
		return delta * segmentLength;
	}

	static long getNeutralDelta() {
		return 0;
	}

	static long getNeutralValue() {
		return 0;
	}

	// generic code
	static Random random = new Random();

	static long joinValueWithDelta(long value, long delta) {
		if (delta == getNeutralDelta()) return value;
		return modifyOperation(value, delta);
	}

	static long joinDeltas(long delta1, long delta2) {
		if (delta1 == getNeutralDelta()) return delta2;
		if (delta2 == getNeutralDelta()) return delta1;
		return modifyOperation(delta1, delta2);
	}

	public static class Treap {
		long nodeValue;
		long subTreeValue;
		long delta;
		int count;
		long prio;
		Treap left;
		Treap right;

		Treap(int value) {
			nodeValue = value;
			subTreeValue = value;
			delta = getNeutralDelta();
			count = 1;
			prio = random.nextLong();
		}

		void update() {
			subTreeValue = queryOperation(queryOperation(getSubTreeValue(left), nodeValue), getSubTreeValue(right));
			count = 1 + getCount(left) + getCount(right);
		}
	}

	static int getCount(Treap root) {
		return root == null ? 0 : root.count;
	}

	static long getSubTreeValue(Treap root) {
		return root == null ? getNeutralValue() : root.subTreeValue;
	}

	static void applyDelta(Treap root, long delta) {
		if (root == null)
			return;
		root.delta = joinDeltas(root.delta, delta);
		root.nodeValue = joinValueWithDelta(root.nodeValue, delta);
		root.subTreeValue = joinValueWithDelta(root.subTreeValue, deltaEffectOnSegment(delta, root.count));
	}

	static void pushDelta(Treap root) {
		if (root == null)
			return;
		applyDelta(root.left, root.delta);
		applyDelta(root.right, root.delta);
		root.delta = getNeutralDelta();
	}

	public static class TreapPair {
		Treap left;
		Treap right;

		TreapPair(Treap left, Treap right) {
			this.left = left;
			this.right = right;
		}
	}

	public static TreapPair split(Treap root, int minRight) {
		if (root == null)
			return new TreapPair(null, null);
		pushDelta(root);
		if (getCount(root.left) >= minRight) {
			TreapPair sub = split(root.left, minRight);
			root.left = sub.right;
			root.update();
			sub.right = root;
			return sub;
		} else {
			TreapPair sub = split(root.right, minRight - getCount(root.left) - 1);
			root.right = sub.left;
			root.update();
			sub.left = root;
			return sub;
		}
	}

	public static Treap merge(Treap left, Treap right) {
		pushDelta(left);
		pushDelta(right);
		if (left == null)
			return right;
		if (right == null)
			return left;
		if (left.prio > right.prio) {
			left.right = merge(left.right, right);
			left.update();
			return left;
		} else {
			right.left = merge(left, right.left);
			right.update();
			return right;
		}
	}

	public static Treap insert(Treap root, int index, int value) {
		TreapPair t = split(root, index);
		return merge(merge(t.left, new Treap(value)), t.right);
	}

	public static Treap remove(Treap root, int index) {
		TreapPair t = split(root, index);
		return merge(t.left, split(t.right, index + 1 - getCount(t.left)).right);
	}

	/*
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		int n = in.nextInt();
		int q = in.nextInt();
		Treap treap = null;
		int[] h = new int[n];
		for (int i = 0; i < n; i++) {
			h[i] = in.nextInt();
			treap = insert(treap, h[i]);
		}
		for (int i = 0; i < q; i++) {
			int t = in.nextInt();
			if (t == 1) {
				int p = in.nextInt() - 1;
				int x = in.nextInt();
				treap = remove(treap, h[p]);
				treap = insert(treap, x);
				h[p] = x;
			} else {
				long v = Long.parseLong(in.next());
				res = Double.POSITIVE_INFINITY;
				dfs(treap, v, 0, 0);
				out.printf("%.5f\n", res);
			}
		}
	}

	static double res;

	static void dfs(Treap root, long v, int cnt, long sum) {
		if (root == null)
			return;
		int totalCount = getCount(root.left) + cnt + 1;
		long totalSum = getSum(root.left) + sum + root.key;
		double level = (double) (totalSum + v) / totalCount;
		res = Math.min(res, level);
		if (totalSum + v <= (long) root.key * totalCount) {
			dfs(root.left, v, cnt, sum);
		} else {
			dfs(root.right, v, totalCount, totalSum);
		}
	}

	static Random random = new Random();

	static class Treap {
		int key;
		long prio;
		Treap left;
		Treap right;
		int count;
		long sum;

		Treap(int key) {
			this.key = key;
			prio = random.nextLong();
			count = 1;
			sum = key;
		}

		void update() {
			count = 1 + getCount(left) + getCount(right);
			sum = key + getSum(left) + getSum(right);
		}
	}

	static int getCount(Treap root) {
		return root == null ? 0 : root.count;
	}

	static long getSum(Treap root) {
		return root == null ? 0 : root.sum;
	}

	static class TreapPair {
		Treap left;
		Treap right;

		TreapPair(Treap left, Treap right) {
			this.left = left;
			this.right = right;
		}
	}

	static TreapPair split(Treap root, int minRight) {
		if (root == null)
			return new TreapPair(null, null);
		if (root.key >= minRight) {
			TreapPair leftSplit = split(root.left, minRight);
			root.left = leftSplit.right;
			root.update();
			leftSplit.right = root;
			return leftSplit;
		} else {
			TreapPair rightSplit = split(root.right, minRight);
			root.right = rightSplit.left;
			root.update();
			rightSplit.left = root;
			return rightSplit;
		}
	}

	static Treap merge(Treap left, Treap right) {
		if (left == null)
			return right;
		if (right == null)
			return left;
		if (left.prio > right.prio) {
			left.right = merge(left.right, right);
			left.update();
			return left;
		} else {
			right.left = merge(left, right.left);
			right.update();
			return right;
		}
	}

	static Treap insert(Treap root, int x) {
		TreapPair t = split(root, x);
		return merge(merge(t.left, new Treap(x)), t.right);
	}

	static Treap remove(Treap root, int x) {
		if (root == null) {
			return null;
		}
		if (x < root.key) {
			root.left = remove(root.left, x);
			root.update();
			return root;
		} else if (x > root.key) {
			root.right = remove(root.right, x);
			root.update();
			return root;
		} else {
			return merge(root.left, root.right);
		}
	}
*/
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream));
	}

	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}
}