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.util.List;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.util.Collections;
import java.util.Collection;
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);
		TaskEE solver = new TaskEE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskEE {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int q = in.nextInt();
        int[] a = new int[n];
        List<Integer> allList = new ArrayList<Integer>(n);
        for (int i = 0; i < n; ++i) {
            a[i] = in.nextInt();
            allList.add(a[i]);
        }
        long[] water = new long[q];
        int[] type = new int[q];
        int[] val = new int[q];
        int[] pos = new int[q];
        for (int i = 0; i < q; ++i) {
            type[i] = in.nextInt();
            if (type[i] == 1) {
                pos[i] = in.nextInt()-1;
                val[i] = in.nextInt();
                allList.add(val[i]);
            } else {
                water[i] = in.nextLong();
            }
        }
        CollectionUtils.unique(allList);
        int[] all = CollectionUtils.toArray(allList);
        int N = all.length;

        FenwickTreeSum aSum = new FenwickTreeSum(N);
        FenwickTreeSumInt bSum = new FenwickTreeSumInt(N);

        for (int i = 0; i < n; ++i) {
            a[i] = Arrays.binarySearch(all, a[i]);
            aSum.update(a[i], all[a[i]]);
            bSum.update(a[i], 1);
        }

        for (int i = 0; i < q; ++i) {
            if (type[i] == 1) {
                int id = pos[i];
                int newVal = Arrays.binarySearch(all, val[i]);
                aSum.update(a[id], -all[a[id]]);
                bSum.update(a[id], -1);

                aSum.update(newVal, all[newVal]);
                bSum.update(newVal, 1);

                a[id] = newVal;
            } else {
                long add = water[i];

                double left = 0;
                double right = 2 * 1e15;
                for (int iter = 0; iter < 70; ++iter) {
                    double middle = (left + right) / 2;
                    int p = binSearch(all, middle);
                    long sum = aSum.getPrefixSum(p);
                    long t = bSum.getPrefixSum(p);
                    if (p == -1) {
                        left = middle;
                        continue;
                    }
                    double res = 1. * (sum + add) / t;
                    if (res < middle) {
                        right = middle;
                    } else {
                        left = middle;
                    }
                }
                out.printf("%.5f\n", (left + right) / 2);
            }
        }
    }

    private int binSearch(int[] all, double x) {
        int left = -1, right = all.length;
        while (left + 1 < right) {
            int mid = (left + right) / 2;
            if (all[mid] <= x) {
                left = mid;
            } else {
                right = mid;
            }
        }
        return left;
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer stt;

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

    public String nextLine() {
        try {
            return reader.readLine().trim();
        } catch (IOException e) {
            return null;
        }
    }

    public String nextString() {
        while (stt == null || !stt.hasMoreTokens()) {
            stt = new StringTokenizer(nextLine());
        }
        return stt.nextToken();
    }

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

    public long nextLong() {
        return Long.parseLong(nextString());
    }

}

class CollectionUtils {
    public static int[] toArray(Collection<Integer> collection) {
        int[] result = new int[collection.size()];
        int index = 0;
        for (int element : collection) {
            result[index++] = element;
        }
        return result;
    }

    //    public static List<Double> unique(List<Double> a) {
//        List<Double> result = new ArrayList<Double>();
//        result.add(a.get(0));
//        int last = 0;
//        for (int i = 1; i < a.size(); ++i) {
//            if (DoubleUtils.compareTo(a.get(i), result.get(last)) != 0) {
//                result.add(a.get(i));
//                ++last;
//            }
//        }
//        return result;
//    }

    public static void unique(List<Integer> a) {
        Collections.sort(a);
        int size = 1;
        for (int i = 1; i < a.size(); i++) {
            if (!a.get(i).equals(a.get(size - 1))) {
                a.set(size++, a.get(i));
            }
        }
        for (int i = a.size() - 1; i >= size; i--) {
            a.remove(i);
        }
    }

}

class FenwickTreeSum {
    long[] sum;
    int n;

    public FenwickTreeSum(int n) {
        this.n = n;
        sum = new long[n+1];
        Arrays.fill(sum, 0);
    }

    public void update(int position, long value) {
        ++position;
        for (int i = position; i <= n; i = next(i)) {
            sum[i] += value;
        }
    }

    public long getPrefixSum(int position) {
        ++position;
        long result = 0;
        for (int i = position; i > 0; i = prev(i)) {
            result += sum[i];
        }
        return result;
    }

    private static int prev(int x) {
        return (x & (x - 1));
    }

    private static int next(int x) {
        return (x << 1) - prev(x);
    }
}

class FenwickTreeSumInt {
    int[] sum;
    int n;

    public FenwickTreeSumInt(int n) {
        this.n = n;
        sum = new int[n+1];
        Arrays.fill(sum, 0);
    }

    public void update(int position, int value) {
        ++position;
        for (int i = position; i <= n; i = next(i)) {
            sum[i] += value;
        }
    }

    public int getPrefixSum(int position) {
        ++position;
        int result = 0;
        for (int i = position; i > 0; i = prev(i)) {
            result += sum[i];
        }
        return result;
    }

    private static int prev(int x) {
        return (x & (x - 1));
    }

    private static int next(int x) {
        return (x << 1) - prev(x);
    }
}