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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;


public class E {	
	BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;
    
	public void solve() throws IOException {				
		int N = nextInt();
        int Q = nextInt();
        long[] A = new long[N];

        for (int i = 0; i < N; i++) {
            A[i] = nextLong();
        }

        int itemCnt = N;
        long[][] QS = new long[Q][];
        for (int i = 0; i < Q; i++) {
            int type = nextInt();
            if (type == 1) {
                QS[i] = new long[] {1, nextLong()-1, nextLong()};
                itemCnt++;
            } else {
                QS[i] = new long[] {2, nextLong()};
            }
        }

        long[][] items = new long[itemCnt][];
        int cur = 0;
        for (int i = 0; i < N; i++) {
            items[cur++] = new long[] {i, A[i]};
        }
        for (int i = 0; i < Q; i++) {
            if (QS[i][0] == 1) {
                items[cur++] = new long[] {N+i, QS[i][2]};
            }
        }

        Arrays.sort(items, new Comparator<long[]>() {
            @Override
            public int compare(long[] a, long[] b) {
                return (int) (a[1] - b[1]);
            }
        });

        long[] cum = new long[itemCnt];
        long[] total = new long[itemCnt];
        for (int i = 0; i < itemCnt; i++) {
            if (items[i][0] < N) {
                add(total, i, items[i][1]);
                add(cum, i, 1);
            }
        }

        int[] qsIndex = new int[Q];
        int[] fromItem = new int[N];
        for (int i = 0; i < itemCnt; i++) {
            if (items[i][0] < N) {
                fromItem[(int) items[i][0]] = i;
            } else {
                qsIndex[(int) items[i][0] - N] = i;
            }
        }

        for (int i = 0; i < Q; i++) {
            if (QS[i][0] == 2) {
                double v = QS[i][1];
                int l = 0;
                int r = itemCnt-1;
                while (l < r) {
                    int mid = (l + r) / 2;
                    if ( (mid == itemCnt-1) || ( sum(cum, mid) * items[mid+1][1] - sum(total, mid) >= v) ) {
                        r = mid;
                    } else {
                        l = mid + 1;
                    }
                }
                double ans = (v - (sum(cum,l) * items[l][1] - sum(total,l))) / sum(cum,l) + items[l][1];
                out.println(ans);
            } else {
                int P = (int) QS[i][1];
                long X = QS[i][2];
                int itemIndex = qsIndex[i];

                add(total, fromItem[P], -1 * items[fromItem[P]][1]);
                add(cum, fromItem[P], -1);

                fromItem[P] = itemIndex;
                add(total, fromItem[P], items[fromItem[P]][1]);
                add(cum, fromItem[P], 1);

//                for (int j = 0; j < N; j++) {
//                    out.println("from " + j + ": " + fromItem[j]);
//                }
            }
        }

//        for (int i = 0; i < itemCnt; i++) {
//            out.println(i + ": " + sum(total, i) + ", " + sum(cum, i));
//        }

	}

    public void add(long[] t, int i, long value) {
        for (; i < t.length; i += (i + 1) & -(i + 1))
            t[i] += value;
    }

    // sum[0..i]
    public long sum(long[] t, int i) {
        long res = 0;
        for (; i >= 0; i -= (i + 1) & -(i + 1))
            res += t[i];
        return res;
    }
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new E().run();
	}
	
	public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            out = new PrintWriter(System.out);
            solve();
            reader.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

}