import math
cook your dish here
T = int(input())
while T:
T = T- 1
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
res = sum(A)
f = A[0]
s = A[1]
for i in range(1,K+1):
res += math.ceil(((2^i - 1)*f + s)/2^i)
print(res)
What’s wrong in this code?