n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
i = n-1
score = 0
while i>=1:
    if abs(a[i]-a[i-1])<=k:
        score += a[i]*a[i-1]
        i-=2
    else:
        i-=1
print(score)