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.*;
import java.io.*;

public class ChemistryExperiment {
    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int N = scanner.nextInt();
        int Q = scanner.nextInt();
        int[] arr = new int[N+1];
        TreeSet<Integer> set = new TreeSet<>();
        for(int i = 1; i <= N; i++) {
            arr[i] = scanner.nextInt();
            set.add(arr[i]);
        }
        ArrayDeque<Tuple> queue = new ArrayDeque<>();
        for(int i = 0; i < Q; i++ ) {
            int a = scanner.nextInt();
            long b = scanner.nextLong();
            if (a == 1) {
                int c = scanner.nextInt();
                queue.offer(new Tuple(a, b, c));
                set.add(c);
            }
            else {
                queue.offer(new Tuple(a,b,-1));
            }
        }
        HashMap<Integer, Integer> val2Ind = new HashMap<>();
        int[] mapping = new int[set.size()+1];
        int ind = 1;
        for(int num : set) {
            mapping[ind] = num;
            val2Ind.put(num, ind++);
        }
        //init our bits
        BIT cnt = new BIT(set.size()+1);
        BIT vol = new BIT(set.size()+1);
        for(int i = 1; i <= N; i++) {
            cnt.update(val2Ind.get(arr[i]), 1);
            vol.update(val2Ind.get(arr[i]), arr[i]);
        }
        
        while(!queue.isEmpty()) {
            Tuple next = queue.poll();
            if (next.a == 1) {
                //remove current value
                cnt.update(val2Ind.get(arr[(int)next.b]), -1);
                vol.update(val2Ind.get(arr[(int)next.b]), -arr[(int)next.b]);
                cnt.update(val2Ind.get(next.c), 1);
                vol.update(val2Ind.get(next.c), next.c);
                arr[(int)next.b] = next.c;
            }
            else {
                double best = Double.POSITIVE_INFINITY;
                int hi = set.size();
                int lo = 1;
                while(lo <= hi) {
                    int mid = (lo + hi)/2;
                    long sum = cnt.prefixSum(mid);
                    long vols = vol.prefixSum(mid);
                    double avg = (double)(vols + next.b)/sum;
                    best = Math.min(best, avg);
                    if (avg <= mapping[mid]) {
                        hi = mid-1;
                    }
                    else {
                        lo = mid + 1;
                    }
                }
                out.println(best);
            }
        }
        out.flush();
    }
    public static class Tuple {
        int a, c;
        long b;
        public Tuple(int aa, long bb, int cc) {
            a = aa;
            b = bb;
            c = cc;
        }
    }
    
    
    public static class BIT{
        long[] table;
        int size;
        public BIT(int ss) {
            table = new long[ss];
            size = ss;
        }
        public void update(int loc, long amt) {
            while(loc < size) {
                table[loc]+= amt;
                loc+=Integer.lowestOneBit(loc);
            }
        }
        public long prefixSum(int loc) {
            long ret = 0;
            while(loc > 0) {
                ret += table[loc];
                loc-=Integer.lowestOneBit(loc);
            }
            return ret;
        }
        public long rangeSum(int l, int r) {
            return prefixSum(r)-prefixSum(l-1);
        }
    }
    
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
        
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
    }
}