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 w_{i} 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 ≤ 10^5, 1 ≤ k ≤ 10^9) — the number of different pebble types and number of pebbles Anastasia can place in one pocket.

The second line contains n integers w_1, w_2, ..., w_{n} (1 ≤ w_{i} ≤ 10^4) — 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.

Difficulty: interview

Starter code:

Solutions:
n, k = [int(i) for i in input().split()]

w = [int(i) for i in input().split()]

tot = 0
for wi in w:
    tot += (wi+k-1)//k

ans = (tot+1)//2
print(ans)


n,k=[int(i) for i in input().split()]
a=[int(i) for i in input().split()]
x=0
for i in range(n):
    x+=(a[i]+k-1)//k
print((x+1)//2)

N, K = list(map(int, input().split()))
W = [int(x) for x in input().split()]
ans = 0
for w in W:
    if w % K == 0:
        ans += w // K
    else:
        ans += w // K + 1
if ans % 2 == 0:
    print(ans // 2)
else:
    print(ans // 2 + 1)


from sys import stdin
import math

N, K = list(map(int, stdin.readline().split()))
pebbles = list(map(int, stdin.readline().split()))

print(math.ceil(sum(math.ceil(p / K) for p in pebbles) / 2))


n, k = map(int, input().split())
array = list(map(int, input().split()))
ans = 0
for i in range (n):
    ans += (array[i] + k - 1) // k
print((ans + 1) // 2)

n, k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
res = 0
for i in a:
    res += (i+k-1) // k

print((res+1)//2)

from sys import stdin, stdout


n, k = list(map(int, stdin.readline().rstrip().split()))

pebbleList = [int(a) for a in stdin.readline().rstrip().split()]

nTrips=[]
for i in range(n):
    nTrips.append(pebbleList[i]//k)
    if pebbleList[i]%k!=0:
        nTrips[i]+=1

total = sum(nTrips)//2 + sum(nTrips)%2
print(total)




n, k = list(map(int, input().split()))

ws = list(int(x) for x in input().split())

result = 0
free_pocket = False


for w in ws:
    needed_pockets = (w + k - 1) // k
    if needed_pockets % 2 == 0:
        result += needed_pockets // 2
    else:
        if free_pocket:
            result += (needed_pockets - 1) // 2
        else:
            result += (needed_pockets + 1) // 2
        free_pocket = not free_pocket

print(result)


n, k = map(int, input().split())
a = list(map(int, input().split()))

ans = 0
for i in range(n):
    ans += (a[i] - 1) // k + 1
    
print((ans - 1) // 2 + 1)

import sys
n,k = list(map(int, input().split()))
w = list(map(int, input().split()))
rem = 0
ans = 0
for i in range(n):
    
    if w[i] % k != 0:
        rem +=1
    ans += w[i] // k;
res = 0
res += ans// 2
if ans % 2 != 0:
    rem += 1
res += rem // 2
if rem % 2 != 0:
    res += 1
print(res)


n,k=map(int,input().split())
ip=list(map(int,input().split()))
count=0
for i in ip:
    if i%k==0:
        count+=i//k
    else:
        count+=(i//k)+1
if count %2==0:
    print(count//2)
else:
    print(count//2 + 1)

import math
n,k=list(map(int,input().split()))
w=[int(i) for i in input().split()]
res=[]
for i in range(n):
    res.append(w[i]//k)
    res.append(bool(w[i]%k))
print(math.ceil(sum(res)/2))


n, k = map(int, input().split())
days = 0
w = list(map(int, input().split()))
for wi in w:
    days += (wi - 1) // k + 1
print((days - 1) // 2 + 1)

n,k=map(int,input().split())
l=sorted(map(int,input().split()))
ans=0
for i in range(n):
    ans+=-(-l[i]//k)
print(-(-ans//2))

n,k=map(int,input().split())
l=[int(i) for i in input().split()]
ans=[]
for i in l:
    ans.append((i+k-1)//k)
print((sum(ans)+1)//2)

#!/usr/bin/env python3


def ri():
    return list(map(int, input().split()))


n, k = ri()

w = list(ri())

ans = 0
for ww in w:
    if ww % k == 0:
        ans += ww//k
    else:
        ans += ww//k + 1

if ans%2:
    print(ans//2+1)
else:
    print(ans//2)

print()



n,k=map(int,input().split())
d=0
t = sum(((i-1)//k + 1) for i in map(int,input().split()))
print((t-1)//2 + 1)

from math import *
n,k = list(map(int,input().split()))
*m,=list(map(int,input().split()))
d=0.0
for i in m:
    d+=ceil(i/k)
print(ceil(d/2))


n, k = [int(i) for i in input().split()]
w = [int(i) for i in input().split()]
w.sort()
m = 0
for i in w:
    m += (i + k - 1) // k

print((m + 1) // 2)

from math import ceil

n, s = list(map(int, input().split()))

peb = list(map(int, input().split()))

d = 0

for p in peb:
    d += ceil(p / s)

print(ceil(d/2))


def R():
    return [int(x) for x in input().split()]

def __starting_point():
    n, k = R()
    w = R()
    result = 0
    for _w in w:
        if _w < k:
            result += 1
        elif _w % k == 0:
            result += _w // k
        else:
            result += _w // k + 1

    if result % 2 == 0:
        print(result // 2)
    else: 
        print(result // 2 + 1)

__starting_point()

from collections import deque
from sys import stdin
from math import ceil
lines = deque(line.strip() for line in stdin.readlines())

def nextline():
    return lines.popleft()

def types(cast):
    return tuple(int(x) for x in nextline().split())

def ints():
    return types(int)

def strs():
    return nextline().split()

def main():
    # lines will now contain all of the input's lines in a list
    n, k = ints()
    ws = ints()
    count = ceil(sum(ceil(x/k) for x in ws)/2)
    print(count)


def __starting_point():
    main()

__starting_point()

import sys
import math

fin = sys.stdin
fout = sys.stdout
n, k = list(map(int, fin.readline().split()))
a = list(map(int, fin.readline().split()))
ans = 0
i = 0
while i < n:
    ans += math.ceil(a[i] / k)
    i += 1
fout.write(str(math.ceil(ans / 2)))


import math
n,k=list(map(int,input().split()))
line=list(map(int,input().split()))
cnt=0
for x in line:
	cnt+=math.ceil(x/k)
print(math.ceil(cnt/2))


n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
counterS = 0
counterL = 0

for i in arr:
    if i <= k:
        counterS += 1
    else:
        if i <= 2 * k:
            counterL += 1
        else:
            counterL += (i // (2 * k))
            y = i - (i // (2 * k))*(2*k)
            if y <= k:
                if y != 0:
                    counterS += 1
            else:
                counterL += 1
lastCounter = (counterS // 2) + (counterS % 2) + counterL
print(lastCounter)