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

public class CF247_ChemBIT
{
   public static void main(String[] args)
   {
      Scanner scan = new Scanner();
      
      int n = scan.nextInt();
      int q = scan.nextInt();
      
      TreeSet<Integer> allVals = new TreeSet<Integer>();
      
      int[] vals = new int[n];
      for(int i = 0; i<n; i++)
      {
         int x = scan.nextInt();
         allVals.add(x);
         vals[i] = x;
      }
      
      ArrayList<Integer> M = new ArrayList<Integer>(q);
      ArrayList<Integer> P = new ArrayList<Integer>();
      ArrayList<Integer> X = new ArrayList<Integer>();
      ArrayList<Long> V = new ArrayList<Long>();
      
      for(int i = 0; i<q; i++)
      {  
         M.add(scan.nextInt());
         if(M.get(i)==1)
         {
            P.add(scan.nextInt()-1);
            
            int x = scan.nextInt();
            X.add(x);
            allVals.add(x);
         }
         else
         {
            V.add(scan.nextLong());
         }
      }
      
      HashMap<Integer, Integer> valueToInd = new HashMap<Integer, Integer>();
      HashMap<Integer, Integer> indToVal = new HashMap<Integer, Integer>();
      
      int ind = 1;
      for(int i : allVals)
      {
         valueToInd.put(i, ind);
         indToVal.put(ind, i);
         ind++;
      }
      
      BIT freq = new BIT(ind);
      BIT sum = new BIT(ind);
      
      for(int i = 0; i<n; i++)
      {
         int idx = valueToInd.get(vals[i]);
         freq.update(idx, 1);
         sum.update(idx, vals[i]);
      }
      
      int oneInd = 0;
      int twoInd = 0;
      for(int i = 0; i<q; i++)
      {
         if(M.get(i)==1)
         {
            int p = P.get(oneInd);
            int x = X.get(oneInd);
            oneInd++;
            int cur = vals[p];
                        
            freq.update(valueToInd.get(cur), -1);
            sum.update(valueToInd.get(cur), -cur);
            
            freq.update(valueToInd.get(x), 1);
            sum.update(valueToInd.get(x), x);
            
            vals[p] = x;
            
         }
         else
         {
            long v = V.get(twoInd);
            twoInd++;
            gMin = Double.POSITIVE_INFINITY;
            
            findMin(freq, sum, 1, ind-1, v,indToVal);
            System.out.printf("%.5f\n", gMin);
         }
      }
   }
   
   public static void findMin(BIT freq, BIT sum, int min, int max, long v, HashMap<Integer, Integer> indToVal)
   {
      if(max<min)
         return;
      int idx = min + (max-min)/2;
      long totalSum = sum.read(idx);
      long totalCount = freq.read(idx);
      
      double avg = (double)(totalSum+v)/totalCount;
      if(avg<=(indToVal.get(idx)))
      {
         findMin(freq, sum, min, idx-1, v,indToVal);
      }
      else
      {
         gMin = Math.min(gMin, avg);
         findMin(freq, sum, idx+1, max, v,indToVal);
      }
   }
   
   static double gMin;
   
   public static class BIT
   {
      long[] tree;
      long[] freq;
      int MaxVal;
      
      public BIT(int n)
      {
         tree = new long[n];
         freq = new long[n];
         MaxVal = n;
      }
      
      public long read(int idx)
      {
         long sum = tree[0];
         while(idx>0)
         {
            sum+=tree[idx];
            idx -= (idx & -idx);
         }
         return sum;
      }
      
      public void update(int idx, int val)
      {
         freq[idx] += val;
         if(idx != 0)
         {
            while(idx<MaxVal)
            {
               tree[idx] += val;
               idx += (idx & -idx);
            }
         }
         else
         {
            tree[0]  += val;
         }
      }
      
      public long single(int idx)
      {
         return freq[idx];
      }
      
   }
   
   public static class Scanner {
      BufferedReader br;
      StringTokenizer st;
   
      public Scanner(Reader in) {
         br = new BufferedReader(in);
      }
   
      public Scanner() { 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()); }
   
        // Slightly different from java.util.Scanner.nextLine(),
        // which returns any remaining characters in current line,
        // if any.  
      String readNextLine() {
         String str = "";
         try {
            str = br.readLine();
         } 
         catch (IOException e) {
            e.printStackTrace();
         }
         return str;
      }
   }
   
}