Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the pebbles she could find in the park.

She has only two pockets. She can put at most k pebbles in each pocket at the same time. There are n different pebble types in the park, and there are wi pebbles of the i-th type. Anastasia is very responsible, so she never mixes pebbles of different types in same pocket. However, she can put different kinds of pebbles in different pockets at the same time. Unfortunately, she can't spend all her time collecting pebbles, so she can collect pebbles from the park only once a day.

Help her to find the minimum number of days needed to collect all the pebbles of Uzhlyandian Central Park, taking into consideration that Anastasia can't place pebbles of different types in same pocket.

Input

The first line contains two integers n and k (1 ≤ n ≤ 105, 1 ≤ k ≤ 109) — the number of different pebble types and number of pebbles Anastasia can place in one pocket.

The second line contains n integers w1, w2, ..., wn (1 ≤ wi ≤ 104) — number of pebbles of each type. 

Output

The only line of output contains one integer — the minimum number of days Anastasia needs to collect all the pebbles.

Examples

Input

3 2
2 3 4


Output

3


Input

5 4
3 1 8 9 7


Output

5

Note

In the first sample case, Anastasia can collect all pebbles of the first type on the first day, of second type — on the second day, and of third type — on the third day.

Optimal sequence of actions in the second sample case: 

  * In the first day Anastasia collects 8 pebbles of the third type. 
  * In the second day she collects 8 pebbles of the fourth type. 
  * In the third day she collects 3 pebbles of the first type and 1 pebble of the fourth type. 
  * In the fourth day she collects 7 pebbles of the fifth type. 
  * In the fifth day she collects 1 pebble of the second type. 

import java.util.*;
import java.io.*;

 /*
 Although copied but copying snippet does'nt Gurantee AC :-) 
 ~~~~~~~~ ksj ~~~~~~~
 */

//Did I need Public ??????????????/ 

public class prob1_2{
    
  	 //public static int max = (int) (1e9+7);
    
     public static void main(String[] args) {
        new Thread(null ,new Runnable(){
            public void run(){
                try{
                    solve();
                } catch(Exception e){
                    e.printStackTrace();
                }
            }
        },"1",1<<26).start();
    }

    // public static long xl,yl,z1,al,bl,cl,dl,el;
    // public static int x,y,z,a,b,c,d,e,T;
    
    // public static ArrayList<Integer> factor[]=new ArrayList[100001];

   ///>>>>>	  |+++ START FROM  HERE BRO' 
   /// 
    public static void solve() {
 
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        
			int n=in.nextInt();

			int k=in.nextInt();

			//Queue<Integer> q=new LinkedList<Integer>();
			int sum=0;

			int v=0;
			for(int i=0;i<n;i++){
				v=in.nextInt();
				sum+=Math.ceil(v/(float)k);
			}
			//System.out.println("<>"+q);
			int count=0,t=0;
			
			
			out.println((int)Math.ceil(sum/2.0));
        //out.println("");
        out.close();
    }
    // for pair value use for i> adjecnt ii> weigth iii> cost

    static class Node {
    	int i,dis;
    	 Node(int i, int dis){
    		this.i=i; this.dis=dis;
    	} 
    }	

   // public static Queue<Integer> q=new LinkedList<Integer>();

    //PriorityQueue p=new PriorityQueue<Integer>(capacity,comparable{necessary of want to customize})
    // public static boolean v[]=new boolean[a];	
    // public void Bfs(ArrayList<Integer> g[],int s,boolean v[]){
    // 	Arrays.fill(v,false);
    // 	q.add(s);
    // 	v[s]=false;
    // 	int t,size,t1;

    // 	while(!q.isEmpty()){
    // 		t=q.poll();
    // 		size=g[t].size();
    // 		for(int i=0;i<size;i++){
    // 					//mark its all adjecent...
    // 			if(v[g[t].get(i)]==false){
    // 				t1=g[t].get(i);
    // 				q.add(t1);

    // 			}
    // 		}
    // 	}


    // }
/*------------------------------------------Pair ----------------------Modified ------------------------->>>>>>>>*/

    static class Pair implements Comparable<Pair>{
        int x,y,i;
        
	Pair (int x,int y,int i){
		this.x=x;
		this.y=y;
		this.i=i;
	}

	Pair (int x,int y){
		this.x=x;
		this.y=y;
	}
        
	public int compareTo(Pair o) {
		if(this.x!=o.x) return Integer.compare(this.x,o.x);
		else       return Integer.compare(this.y,o.y);
	}
 
	 public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair)o;
                return p.x == x && p.y == y && p.i==i;
            }
            return false;
    }
    public int hashCode() {
            return new Integer(x).hashCode() * 31 + new Integer(y).hashCode()+new Integer(i).hashCode()*37;
    }
    
    } 
 //>>>>>>>>>>>>>>>>>>>>>____________________________________________END

 //XXXXXXXXXXXXX Library funtion --------------- Don't Cheat :-> use ur's ________________________________   
    
    //  public void factor(){
    // 	//initialitation ...........

    // 	for(int i=1;i<100001;i++){factor[i]=new ArrayList<Integer>();}
    // 		factor[1].add(1);
    // 	for(int i=1;i<316;i++){
    // 		for(int j=2;j<100001;j+=i){
    // 			factor[j].add(i);
    // 		}
    // 	}
    // }

    public static boolean isPol(String s){
        for(int i=0, j=s.length()-1;i<=j;i++,j--){
                if(s.charAt(i)!=s.charAt(j)) return false;
        }
        return true;
    }
    public static String rev(String s){
		StringBuilder sb=new StringBuilder(s);
		sb.reverse();
		return sb.toString();
    }
    
    public static long gcd(long x,long y){
	if(x%y==0)
		return y;
	else
		return gcd(y,x%y);
    }
    
    public static int gcd(int x,int y){
	if(x%y==0)
		return y;
	else 
		return gcd(y,x%y);
    }
    //_________________________________IMPO___________________________________
    public static long gcdExtended(long a,long b,long[] x){
        
        if(a==0){
            x[0]=0;
            x[1]=1;
            return b;
        }
        long[] y=new long[2];
        long gcd=gcdExtended(b%a, a, y);
        
        x[0]=y[1]-(b/a)*y[0];
        x[1]=y[0];
        
        return gcd;
    }
    //_________________________________________________________________________
    public static int abs(int a,int b){
	return (int)Math.abs(a-b);
    }
 
    public static long abs(long a,long b){
	return (long)Math.abs(a-b);
    }
    
    public static int max(int a,int b){
	if(a>b)
		return a;
	else
		return b;
    }
 
    public static int min(int a,int b){
	if(a>b)
		return b;
	else 
		return a;
    }
    
    public static long max(long a,long b){
	if(a>b)
		return a;
	else
		return b;
    }
 
    public static long min(long a,long b){
	if(a>b)
		return b;
	else 
		return a;
    }
 
    public static long pow(long n,long p,long m){
	 long  result = 1;
	  if(p==0)
	    return 1;
	if (p==1)
	    return n;
	while(p!=0)
	{
	    if(p%2==1)
	        result *= n;
	    if(result>=m)
	    result%=m;
	    p >>=1;
	    n*=n;
	    if(n>=m)
	    n%=m;
	}
	return result;
    }
    
    public static long pow(long n,long p){
	long  result = 1;
	  if(p==0)
	    return 1;
	if (p==1)
	    return n;
	while(p!=0)
	{
	    if(p%2==1)
	        result *= n;	    
	    p >>=1;
	    n*=n;	    
	}
	return result;
    }
     public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
    //___________________________Fast-Input_Output-------------------******************* 
	static class InputReader {
 
		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;
		private SpaceCharFilter filter;
 
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
 
		public int snext() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int nextInt() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public long nextLong() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = snext();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = snext();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}
 
		public long[] nextLongArray(int n) {
			long a[] = new long[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextLong();
			}
			return a;
		}
                
		public String readString() {
			int c = snext();
			while (isSpaceChar(c)) {
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}
 
		public String nextLine() {
			int c = snext();
			while (isSpaceChar(c))
				c = snext();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = snext();
			} while (!isEndOfLine(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
 
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
}    
//////////                              ~ BSS ittu sa hi hai :-)  ~



    