Problem:
 Score: 200 points    Problem Statement  There are three positive integers A , B and C written on a blackboard. E869120 performs the following operation K times:   Choose one integer written on the blackboard and let the chosen integer be n . Replace the chosen integer with 2n .   What is the largest possible sum of the integers written on the blackboard after K operations?      Constraints   A, B and C are integers between 1 and 50 (inclusive).  K is an integer between 1 and 10 (inclusive).         Input  Input is given from Standard Input in the following format:  A  B  C  K       Output  Print the largest possible sum of the integers written on the blackboard after K operations by E869220.        Sample Input 1 5 3 11
1      Sample Output 1 30  In this sample, 5, 3, 11 are initially written on the blackboard, and E869120 can perform the operation once. There are three choices:   Double 5 : The integers written on the board after the operation are 10, 3, 11 .  Double 3 : The integers written on the board after the operation are 5, 6, 11 .  Double 11 : The integers written on the board after the operation are 5, 3, 22 .   If he chooses 3., the sum of the integers written on the board afterwards is 5 + 3 + 22 = 30 , which is the largest among 1. through 3.       Sample Input 2 3 3 4
2      Sample Output 2 22  E869120 can perform the operation twice. The sum of the integers eventually written on the blackboard is maximized as follows:   First, double 4 . The integers written on the board are now 3, 3, 8 .  Next, double 8 . The integers written on the board are now 3, 3, 16 .   Then, the sum of the integers eventually written on the blackboard is 3 + 3 + 16 = 22 .

Solution (Python):
x = list(map(int,input().split( )))
y = int(input())
xx = sorted(x)
xx[2] *= 2**y
ans = sum(xx)
print(ans)

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
x = max([a,b,c])
print(x*(2**k-1)+sum([a,b,c]))

Solution (Python):
a = sorted(list(map(int, input().split())), reverse=True)
N = int(input())
print((2 ** N) * a[0] + a[1] + a[2])

Solution (Python):
x = input().strip().split(" ")
x = list(map(int, x))

k = int(input())

max_i = x.index(max(x))

big_num = x[max_i]*2**k

del x[max_i]

print(big_num+x[0]+x[1])

Solution (Python):
a,b,c = list(map(int,input().split()))
k = int(input())

BIG = max(a,b,c)
if BIG == a:
  print(BIG*(2**k)+b+c)
elif BIG == b:
  print(BIG*(2**k)+a+c)
else:
  print(BIG*(2**k)+a+b)

Solution (Python):
a,b,c = [int(i) for i in input().split()]
k = int(input())
max = max(a,b,c)
tmp = a+b+c - max

for i in range(k):
    max = max*2

print(tmp+max)

Solution (Python):
N = list(map(int, input().split()))
K = int(input())

N.sort()

N_max = N[0] + N[1] + N[2] * (2 ** K)

print(N_max)

Solution (Python):
a=list(map(int,input().split()))
k=int(input())

for i in range(k):
    a.sort()
    a[2]=a[2]*2

print(sum(a))

Solution (Python):
mohu=input().split()
mohu1=list(map(int,mohu))
mohu1.sort()

kakerukaisu=int(input())
for i in range(kakerukaisu):
    mohu1[2]=mohu1[2]*2
print(mohu1[0]+mohu1[1]+mohu1[2])

Solution (Python):
num = list(map(int, input().split()))
K = int(input())

print(max(num) * 2 ** K + sum(num) - max(num))

Solution (Python):
a,b,c=map(int,input().split())
d=int(input())
print(max(a*2**d+b+c,a+b*2**d+c,a+b+c*2**d))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
m = max(a)
print(m * 2**k + sum(a) - m)

Solution (Python):


instr = raw_input().split()
inint = map(int,instr)
repetitionr= raw_input()
for i in range(int(repetitionr)):
    inint[inint.index(max(inint))] = max(inint) * 2
print sum(inint)

Solution (Python):
a,b,c=[int(i) for i in input().split()]
k=int(input())
li=[a,b,c]
mx=max(x for x in li)
for x in li:
  if x==mx:
    li.remove(x)
    break
print(2**k*mx+sum(li))

Solution (Python):
li=[int(x) for x in input().split()]
k=int(input())
print(max(li)*2**k+sum(li)-max(li))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())

suma = sum(a) - max(a)
maxa = max(a)

for i in range(k):
    maxa *= 2

suma += maxa
print(suma)

Solution (Python):
num = list(map(int, input().split()))
k = int(input())

print(sum(num) - max(num) + max(num) * (2 ** k))

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
m = max(A, B, C)
print(A + B + C + (2**K - 1) * m)

Solution (Python):
p=[int(i) for i in input().split()]
k=int(input())

a=p[0]
b=p[1]
c=p[2]

d=sum(p)-max(p)+(max(p)*(2**k))
print(d)

Solution (Python):
list = map(int, raw_input().split())                                        
K = input()
for i in range(K):
  list[list.index(max(list))] = max(list) * 2
print sum(list)

Solution (Python):
if __name__=='__main__':
    num=[int(n) for n in input().split()]
    k=int(input())
    num.sort(reverse=True)
    s = num[0]*2**k+num[1]+num[2]
    print(s)

Solution (Python):
A = list(map(int,input().split()))
k = int(input())
mx = max(A)
print(sum(A) -mx + mx*(2**k))

Solution (Python):
A, B, C = [int(i) for i in input().split()]
K = int(input())

D = max(A, B, C)*(2**K-1)
print(A+B+C+D)

Solution (Python):
A,B,C = (int(i) for i in input().split())
K = int(input())

for i in range(K):
    maxnum = max(A,B,C)
    if maxnum == A:
        A = maxnum
        A = 2*A
    elif maxnum == B:
        B = maxnum
        B = 2*B
    else:
        C = maxnum
        C = 2*C

print(A+B+C)

Solution (Python):
a,b,c = list(map(int,input().split()))
k = int(input())
sum = 0
in_list = [a,b,c]
sorted_in_list = sorted(in_list,reverse=True)
for i in range(k):sorted_in_list[0] *= 2

sum = sorted_in_list[0] + sorted_in_list[1] + sorted_in_list[2]

print(sum)

Solution (Python):
A = list(map(int, input().split()))
k = int(input())

for i in range(k):
    A[A.index(max(A))] = max(A)*2

print(sum(A))

Solution (Python):
abc = map(int, input().split())
k = int(input())

abc = sorted(abc)
print(abc[0] + abc[1] + abc[2] * (2 ** k))

Solution (Python):
kokuban = list(map(int, input().split()))
k = int(input())


for r in range(k):
    kokuban[kokuban.index(max(kokuban))] *= 2

print(sum(kokuban))

Solution (Python):
ABC = input().split(' ')
K = int(input())
abc = list(map(int, ABC))
abc.sort(reverse=True)
abc[0] = abc[0] * (2 ** K)
print(sum(abc))

Solution (Python):
l = list(map(int,input().split()))
num = int(input())
l[l.index(max(l))] = max(l) * 2 ** (num)
print(sum(l))

Solution (Python):
nums = sorted(map(int, input().split()))
K = int(input())

maximam = max(nums)
nums.pop(2)

print(sum(nums) + maximam * 2**K)

Solution (Python):
A,B,C = map(int, input().split())
K = int(input())
ABC_max = max(A,B,C)
D = ABC_max * (2 ** K)
result = D + A + B + C - ABC_max
print(result)

Solution (Python):
a = sorted(map(int,input().split()))
k = int(input())
a[2] = a[2]*2**k
print(sum(a))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
maxvalue = max(a)*(2**k)
a.remove(max(a))
print(sum(a) + maxvalue)

Solution (Python):
abc = list(map(int,input().split()))
abc.sort()
k = int(input())
print(abc[0] + abc[1] + abc[2]*2**k)

Solution (Python):


A,B,C = map(int,input().split())
N = int(input())

Max = max(A,B,C)

temp = A+B+C - Max

for i in range(N):
    Max = Max * 2

ans = temp + Max

print(ans)

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
D = max([A,B,C]) * 2 ** K
ans = A + B + C + D - max([A,B,C])
print(ans)

Solution (Python):
a=list(map(int,input().split(" ")))
k=int(input())
m=max(a[:])
r=sum(a[:])-m+m*2**k
print(r)

Solution (Python):
A,B,C = map(int, input().split())
K=int(input())
X=0

X=max([A,B,C])

if(X==A):
    A=X*pow(2,K)
elif(X==B):
    B=X*pow(2,K)
else:
    C=X*pow(2,K)

print(A+B+C)

Solution (Python):


a, b, c = map(int, input().split())
K = int(input())


def calcMaximumSum(a, b, c, K):
    maximum = max([a, b, c])
    if(maximum == a):
        return a * (2 ** K) + b + c
    elif(maximum == b):
        return a + b * (2 ** K) + c
    else:
        return a + b + c * (2 ** K)


print(calcMaximumSum(a, b, c, K))

Solution (Python):
ls = list(map(int, input().split()))
k =int(input())
print(sum(ls)+max(ls)*(2**k-1))

Solution (Python):
li = list(map(int, input().split()))
K = int(input())
mo = max(li)
oth = sum(li) - mo
for i in range(K):
    mo *= 2
print(oth + mo)

Solution (Python):
a = list(map(int,input().split()))
K = int(input())
m = max(a)
a.remove(max(a))
print(sum(a)+m*2**K)

Solution (Python):
abc = [int(i) for i in  input().split()]
k = int(input())

max_num = max(abc)
others = sum(abc) - max_num
for i in range(k):
    max_num *= 2

print(max_num + others)

Solution (Python):
abc = [int(i) for i in  input().split()]
k = int(input())

max_num = max(abc)
others = sum(abc) - max_num
for i in range(k):
    max_num *= 2

print(max_num + others)

Solution (Python):
a, b, c = [int(i) for i in input().split()]
k = int(input())

print(a + b + c + max(a, b, c) * (2 ** k - 1))

Solution (Python):
num_list = [int(elem) for elem in input().split(' ')]
K = int(input())

max_num_idx = num_list.index(max(num_list))
for i in range(K):
    num_list[max_num_idx] *= 2

sum_num = sum(num_list)
print(sum_num)

Solution (Python):
A, B, C = list(map(int, input().split()))
K = int(input())
seisuu_list = [A, B, C]
seisuu_list.sort(reverse=True)
for _ in range(K):
    seisuu_list[0] *= 2

sum = seisuu_list[0]+seisuu_list[1]+seisuu_list[2]
print(sum)

Solution (Python):
a=list(map(int,input().split()))
k = int(input())
a.sort()
print(a[0]+a[1]+a[2]*2**k)

Solution (Python):
num = list(map(int, input().split()))
k = int(input())
k_ = 2**k
num.sort()
num[-1] = num[-1]*k_

ans = sum(num)

print(ans)

Solution (Python):
def my_pow (mx,k):
 for i in range (k):
     mx*=2;
 return mx

a,b,c=map(int ,input().split())
k=int(input())
mx=max(a,max(b,c))
print(my_pow(mx,k)-mx+a+b+c)

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
m = max(a,b,c)
output = m*2**k+a+b+c-m
print(output)

Solution (Python):

A,B,C=map(int,input().split())
K=int(input())
a=0
 
if A<=B:
    d=B
else:
    d=A
if d>C: 
	d=d
else:
	d=C

if d==A:
	all=B+C
if d==B:
	all=A+C
if d==C:
	all=B+A

while a<K:
	d*=2
	a+=1

all+=d
print (all)

Solution (Python):

a, b, c = map(int, raw_input().split())
k = int(raw_input())

num = [a, b, c]
max_number = max(num)

for i in range(len(num)):
    if max_number == num[i]:
        key = i

for i in range(k):
    num[key] *= 2

print sum(num)

Solution (Python):



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


p.sort(reverse = True)

for i in range(K):
	p[0] = p[0]*2


print("{}".format(sum(p)))

Solution (Python):
a,b,c = map(int, input().split())
k=int(input())
d=max([a,b,c])*2**k-max([a,b,c])
print(a+b+c+d)

Solution (Python):
num = input().split()
K = int(input())
num = [int(x) for x in num]
num.sort()
num[2] = num[2] * (2 ** K)
print(sum(num))

Solution (Python):
num = list(map(int, input().split()))
times = int(input())
num.sort(reverse=True)

for i in range(times):
    num[0] = num[0]*2

ans = 0
for i in num:
    ans += i

print(ans)

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
m = max(a)
print((m << k) + sum(a) - m)

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
p=max(a,b,c)
ans = a+b+c-p

for i in range(k):
    p *= 2
print(ans+p)

Solution (Python):
a, b, c = list(map(int, input().split()))
k = int(input())

m = max(a, b, c)
print(a + b + c - m + m * 2 ** k)

Solution (Python):
A,B,C=map(int,input().split())
k=int(input())
m=max(A,B,C)
print(A+B+C-m+m*2**k)

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())

print(max(A,B,C)*(2**K-1)+A+B+C)

Solution (Python):
A,B,C = map(int,raw_input().split())
K = int(raw_input())
print(max(A*(2**K)+B+C,B*(2**K)+A+C,C*(2**K)+A+B))

Solution (Python):
ABC = input().split()
K = input()

ABC = [int(s) for s in ABC]
sort_list = sorted(ABC)
print(sort_list[0] + sort_list[1] + (sort_list[2] * (2 ** int(K))))

Solution (Python):
li = list(map(int, input().split()))
K = int(input())
li.sort(reverse=True)
li[0] *= 2 ** K
print(sum(li))

Solution (Python):
a, b, c = [int(i) for i in input().split()]
k = int(input())
max_int = max(a, b, c) * pow(2, k)

print(max_int + (a + b + c - max(a, b, c)))

Solution (Python):
a, b, c = map(int, input().split(" "))
k = int(input())

if a >= b and a >= c:
    print(a * 2**k + b + c)
elif b >= c:
    print(b * 2**k + a + c)
else:
    print(c * 2**k + a + b)

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
print(max(A, B, C)*(2**K)+A+B+C-max(A, B, C))

Solution (Python):


def main():
    a, b, c = map(int, raw_input().split())
    k = int(raw_input())

    print(a + b + c + max(a, b, c)*(2**k - 1))

if __name__ == '__main__':
    main()

Solution (Python):
numList = map(int, raw_input().split())
k = int(raw_input())
maxN = max(numList)
maxIndex = numList.index(maxN)
ans = 0
for i in range(len(numList)):
    if i == maxIndex:
        tmp = maxN
        for j in range(k):
            tmp *= 2
        ans += tmp
    else:
        ans += numList[i]
print ans

Solution (Python):
a,b,c=map(int ,input().split())
K=int(input())

max=a
if b>max:
    max=b
if c>max:
    max=c
sum=a+b+c-max
for i in range(K):
    max*=2
print(sum+max)

Solution (Python):
a,b,c=map(int, input().split())
k =int(input())
m=max(a,b,c)
print(a+b+c-m+m*2**k)

Solution (Python):


a, b, c = map(int, input().split())
k = int(input())



nums = sorted([a, b, c])
num_max = nums[2]
nums_rest = nums[:2]

ans = num_max * (2 ** k) + sum(nums_rest)


print("{}".format(ans))

Solution (Python):


count = 0
sum = 0
A = [int(i) for i in input().split()]
k = int(input())

max_idx = A.index(max(A))
for i in range(k):
    A[max_idx] = A[max_idx] * 2

for i in range(len(A)):
    sum += A[i]

print(sum)

Solution (Python):
a,b,c = map(int,input().split())
K = int(input())

inputL = [a,b,c]
max = a
idx = 0
if(max < b):
    max = b
    idx = 1
if(max < c):
    max = c
    idx = 2

for i in range(K):
    max *= 2

inputL[idx] = max

sum = 0
sum = inputL[0] + inputL[1] + inputL[2]
print(sum)

Solution (Python):
def com(q,p):
    if q<p:
        return p
    else:
        return q

a,b,c=map(int,input().split())
k=int(input())
h=com(com(a,b),c)
if h==a:
    sum=b+c
if h==b:
    sum=c+a
if h==c:
    sum=a+b
while k>0:
    k=k-1
    h=h*2
print(sum+h)

Solution (Python):
A,B,C = [int(i) for i in input().split()]
K = int(input())
print(A+B+C-max([A,B,C])+max([A,B,C])*(2**(K)))

Solution (Python):
a=list(map(int,input().split()))
k=int(input())
print(sum(a)-max(a)+max(a)*2**k)

Solution (Python):
z = list(map(int, input().split()))
K = int(input())

temp = max(z)
for i in range(0, K):
  temp *= 2

ans = sum(z) - max(z) + temp
print(ans)

Solution (Python):


a, b, c = map(int, input().split())
k = int(input())

m = (max(a, b, c))
print(a + b + c + m * 2 ** k - m)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a = LI()
    k = I()
    t = max(a)

    return t * (2**k) + sum(a) - t



print(main())

Solution (Python):




A, B, C = map(int, input().split())

K = int(input())



print("{}".format(A + B + C + max(A, B, C) * ( 2 ** K - 1)))

Solution (Python):
abc = list(map(int, input().split()))
k = int(input())
for i in range(k):
    abc.sort()
    abc[2] = abc[2] * 2
print(sum(abc))

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
print(a+b+c - max(a,b,c) + max(a,b,c)*(2**k))

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
ABC = sorted([A,B,C])
print(ABC[-1] * 2**K + ABC[0] + ABC[1])

Solution (Python):
A, B, C = map(int, input().split(' '))
K = int(input())

print(max(A, B, C) * (2 ** K - 1) + A + B + C)

Solution (Python):
a, b, c = map(int, input().split())
d = int(input())
x = [a,b,c]
max_value = max(x)
index = x.index(max_value)

for i in range(d):
    max_value = max_value * 2

x[index] = max_value
sum = 0
for value in x:
    sum += value
print(sum)

Solution (Python):
li = list(map(int, input().split()))
K = int(input())

print (li[0] + li[1] + li[2] + max(li) * (2 ** K - 1))

Solution (Python):

if __name__ == "__main__":
    nums = list(map(int, input().split()))
    k = int(input())
    ans = 0
    for tmp in nums:
        ans += tmp
    ans += max(nums)*((2**k)-1)
    print(ans)

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
s=0
if a<=b:
    if b<=c:
        s=c*2**k+a+b
    else:
        s=b*2**k+a+c

if b<=a:
    if a<=c:
        s=c*2**k+a+b
    else:
        s=a*2**k+b+c

if c<=a:
    if a<=b:
        s=b*2**k+a+c
    else:
        s=a*2**k+b+c
print(s)

Solution (Python):
a = map(int, raw_input().split())
k = int(raw_input())
s = max(a)
print sum(a) - s + s * (2**k)

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
if a>max(b,c):
    a*=2**k
elif b>c:
    b*=2**k
else:
    c*=2**k
print(a+b+c)

Solution (Python):
a=list(map(int,input().split()))
k=int(input())
b=[0,0,0]
n=1

for i in range(0,3):
    if a[i]==max(a):
        a[i]=a[i]*(2**k)


print(sum(a))

Solution (Python):
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)

k = input()
k = int(k)

print(max(a * 2 ** k + b + c, a + b * 2 ** k + c, a + b + c * 2 ** k))

Solution (Python):
ABC = list(map(int,input().split()))
K = int(input())
for i in range(K):
	ABC = sorted(ABC)
	ABC[2] *= 2

res = sum(ABC)

print(res)

Solution (Python):
N = [int(i) for i in input().split()]
K = int(input())
index_max = N.index(max(N))
i = 0
total = 0
for i in range(3):
    if i != index_max:
        total += N[i]
print(N[index_max]*(2**K)+total)

Solution (Python):


a = list(map(int, input().split()))
n = int(input())
ans = sum(a) + max(a)*((2**n)-1)  
print(ans)

Solution (Python):
arr = list(map(int,input().split()))
arr.sort(reverse=True)
k = int(input())
for i in range(k):
    arr[0] *= 2
print(sum(arr))

Solution (Python):
A, B, C = map(int, input().split(" "))
K = int(input())
if max(A, B, C) == A:
    print(A*(2**K) + B + C)
elif max(A, B, C) == B:
    print(A + B*(2**K) + C)
else:
    print(A + B + C*(2**K))

Solution (Python):
A,B,C = sorted(map(int,input().split()))
K =int(input())
print(A+B+2**K*C)

Solution (Python):
X = map(int, input().split())
K = int(input())

X = sorted(list(X))
print(X[0] + X[1] + X[2] * 2 ** K)

Solution (Python):
num = [int(i) for i in input().split()]
k = int(input())
num = sorted(num)

for _ in range(k):
  num[2] *= 2
 
print(sum(num))

Solution (Python):
A,B,C = map(int,input().split())
K = int(input())
ABC = sorted([A,B,C])
print(ABC[-1] * 2**K + ABC[0] + ABC[1])

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())

d = max(a, b, c)
print(a + b + c + (d * (2 ** k)) - d)

Solution (Python):
if __name__ == "__main__":
    abc = input().replace("　", " ").split(" ")
    abc = [int(x) for x in abc]
    abc.sort(reverse=True)
    k = int(input())
    print(abc[0] * (2**k) + abc[1] + abc[2])

Solution (Python):



A, B, C = map(int, input().split())
K = int(input())


ans = A + B + C + max(A, B, C) * (2**K-1)
print(ans)

Solution (Python):
A, B, C = map(int,input().split())
K = int(input())
L = [A, B, C]
S = sorted(L)

print(S[2] * 2 ** K + S[0] + S[1])

Solution (Python):
abc = list(map(int, input().split()))
k = int(input())

def solve():
    max_abc = max(abc)
    print(sum(abc) + max_abc*(2**k-1))


if __name__ == '__main__':
    solve()

Solution (Python):
abc = list(map(int, input().split()))
K = int(input())
for i in range(K):
    abc[abc.index(max(abc))] *= 2

print(sum(abc))

Solution (Python):
L = list(map(int,input().split()))
K = int(input())
L.sort()
for i in range(K):
    L[-1] *= 2
print(L[0]+L[1]+L[2])

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
mx = max(a)
s = mx*2**k
s += sum(a)-mx
print(s)

Solution (Python):
A,B,C = map(int,input().split( ))
k = int(input())


lis = [A,B,C]
max_num = max(A,B,C)

lis.remove(max_num)

rui = 2 ** k

nibai = max_num * rui


a = lis[0]
b = lis[1]
print(a + b + nibai)

Solution (Python):
A,B,C = map(int,input().split())
k = int(input())


lis = [A,B,C]
max_num = max(A,B,C)

lis.remove(max_num)

rui = 2 ** k

nibai = max_num * rui


a = lis[0]
b = lis[1]
print(a + b + nibai)

Solution (Python):
a, b, c = map(int, input().split())

k = int(input())

for i in range(0, k):
    if a >= b and a >= c:
        a *= 2
    elif b >= a and b >= c:
        b *= 2
    else:
        c *= 2

print(a+b+c)

Solution (Python):
a,b,c=map(int,input().split())
k=int(input())
print(max(a*2**k+b+c,a+b*2**k+c,a+b+c*2**k))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())

ma = max(a)
a.sort()

for i in range(k):
    ma *= 2

print(a[0] + a[1] + ma)

Solution (Python):
abc = [int(i) for i in input().split(" ")]
k = int(input())

abc_max = max(abc)
abc.remove(abc_max)
k_to_abc_max = abc_max * (2 ** k)
board_sum = sum(abc + [k_to_abc_max])

print(board_sum)

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
X=max([A,B,C])
YZ=sum([A,B,C])-X
print(YZ+X*2**K)

Solution (Python):
*x,=map(int,input().split());print(sum(x)+max(x)*(2**int(input())-1))

Solution (Python):
p=input
*x,=map(int, p().split())
print(sum(x)+max(x)*(2**int(p())-1))

Solution (Python):
*x,=map(int, input().split())
print(sum(x)+max(x)*(2**int(input())-1))

Solution (Python):
p=input
*x,=map(int, p().split())
print(sum(x)+max(x)*(2**int(input())-1))

Solution (Python):
x=list(map(int, input().split()))
print(sum(x)+max(x)*(2**int(input())-1))

Solution (Python):
ABC = list(map(int, input().split()))
ABC.sort()
K = int(input())
M = ABC[-1]
print(M*2**K+ABC[0]+ABC[1])

Solution (Python):
P  = list(map(int,input().split()))
P.sort()
p = max(P)
k = int(input())
p = p * 2 ** (k)
print(P[0] + P[1] + p)

Solution (Python):





if __name__ == '__main__':
    numbers = sorted(list(map(int, input().split())))
    k = int(input())
    twice = numbers[2] * 2 ** k
    print(sum(numbers[:2]) + twice)

Solution (Python):
import sys
a, b, c = map(int, sys.stdin.readline().split(' '))
k = int(sys.stdin.readline())
x = max(a, b, c)
print(x * (2 ** k) + a + b + c - x)

Solution (Python):
num = list(map(int,input().split(' ')))
k = int(input())
num.sort(reverse = True)
print(num[0] * (2 ** k) + num[1] + num[2])

Solution (Python):
def solve(a, b, c, k):
    val = a
    for x in [b, c]:
        if val < x:
            val = x
    remain = a + b + c - val
    for i in range(k):
        val *= 2
    return val + remain

def readQuestion():
    import sys
    line = sys.stdin.readline()
    sline = line.rstrip()
    str_a, str_b, str_c = sline.split(' ')
    a = int(str_a)
    b = int(str_b)
    c = int(str_c)
    line = sys.stdin.readline()
    str_k = line.rstrip()
    k = int(str_k)
    return a, b, c, k

def main():
    a, b, c, k = readQuestion()
    ans = solve(a, b, c, k)
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
a, b, c = sorted(map(int, raw_input().split()))
k = input()
print a + b + c*(2**k)

Solution (Python):


a,b,c=map(int,raw_input().split())
k=int(raw_input())
mx=max(a,b,c)
if mx==a:
 print a*2**k+b+c
elif mx==b:
 print b*2**k+a+c
else:
 print c*2**k+a+b

Solution (Python):
def getinputdata():

    
    array_result = []    
    data = input()
    array_result.append(data.split(" "))

    flg = True

    try:
        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
c = int(arr_data[0][2])
k = int(arr_data[1][0])
arr = sorted([a, b, c])

maxdata = arr[-1:][0]

for i in range(1, k + 1):

    maxdata *= 2
    
sumdata = sum(arr[0:len(arr)-1]) + maxdata

print(sumdata)

Solution (Python):
abc = list(map(int, input().split()))
k = int(input())

abc.sort(reverse=True)
abc[0] *= 2 ** k  
print(sum(abc))

Solution (Python):
N = list(map(int,input().split()))
K = int(input())
N.sort()

print(N[0]+N[1]+N[2]*2**K)

Solution (Python):
l = sorted(map(int, input().split()))
k = int(input())
l[2] = l[2] * (2 ** k)
print(sum(l))

Solution (Python):
A=map(int,raw_input().split());m=max(A);print sum(A)+m*2**input()-m

Solution (Python):
s=sorted(list(map(int,input().split())))
print(s[0]+s[1]+s[2]*(2**(int(input()))))

Solution (Python):
*a,=map(int,input().split());m=max(a);print(sum(a)+m*2**int(input())-m)

Solution (Python):
A=sorted(map(int,raw_input().split()));A[2]=A[2]*pow(2,input());print sum(A)

Solution (Python):
x=list(map(int,input().split()));x.sort();print(x[0]+x[1]+x[2]*2**int(input()))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
print(sum(a) + max(a)*(2**k - 1))

Solution (Python):

"""
B - Maximum Sum
https://abc096.contest.atcoder.jp/tasks/abc096_b

"""
import sys
from sys import stdin
input = stdin.readline


def calc_sum(a, b, c, k):
    m = max(a, b, c)
    ans = sum([a, b, c])
    ans -= m
    for _ in range(k):
        m *= 2
    ans += m
    return ans


def main(args):
    a, b, c = map(int, input().split())
    k = int(input())
    ans = calc_sum(a, b, c, k)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
from sys import stdin
a = map(int,stdin.readline().split())
k = int(stdin.readline())
b = max(a)
print b* 2**k + sum(a) - b

Solution (Python):
from collections import deque

A, B, C = map(int, input().split())
K = int(input())

T = [A, B, C]
T.sort(reverse=True)

for _ in range(K):
    T = [T[0] * 2, T[1], T[2]]

print(sum(T))

Solution (Python):
numbers = list(map(int,input().split()))
K = int(input())

D = max(numbers)
for i in range(0,K):
    D = D * 2
    
print(sum(numbers) - max(numbers) + D)

Solution (Python):
s = list(map(int, input().split()))
K = int(input())
s.sort()
for i in range(K):
    s[2] *= 2
print(sum(s))

Solution (Python):

A, B, C = list(map(int,input().strip().split(' ')))
K = int(input().strip())
v = [A,B,C]
import itertools
nums = [0,1,2]
o = 0
for i in itertools.combinations_with_replacement(nums,K):
    tmp = [v[0],v[1],v[2]]
    for j in i:
        tmp[j] = tmp[j]*2
    o = max(o,sum(tmp))
print(o)

Solution (Python):
a,b,c=map(int,raw_input().split())   
k=int(raw_input())
ma=max(a,b,c)
print a+b+c+ma*((2**k)-1)

Solution (Python):
prob = list(map(int, (input().split(" "))))
k = int(input())

prob.sort()

for i in range(k):
    prob[-1] *= 2

print(prob[0] + prob[1] + prob[2])

Solution (Python):
x= list(map(int,input().split()))
k = int(input())
x.sort()
a = x[2]
for i in range(k):
    a = a *2
max = x[0] + x[1] + a
 
print(max)

Solution (Python):
p=input;a=[int(i)for i in p().split()];m=max(a);print(sum(a)-m+m*2**int(p()))

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
L = [A,B,C]
L.sort()
D = L.pop()
D = D*(2**K)
L.append(D)
print(sum(L))

Solution (Python):


tmp=list(map(int,input().split()))
tmp.sort()
K=int(input())
ans=tmp[0]+tmp[1]+(tmp[2]*(2**K))
print(ans)

Solution (Python):
arr = list(map(int, input().split()))
k = int(input())

arr_sorted = sorted(arr)
for i in range(k):
    arr_sorted[-1] *= 2
ans = sum(arr_sorted)
print(ans)

Solution (Python):
import math
import itertools
from heapq import heapify, heappop, heappush
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque








def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_IL(): return LM(int,stdin)


def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))







def primes(max_number):
    """
    指定値未満の素数を取得するジェネレータ
    https://qiita.com/Mokkeee/items/93b6b7d59fa256aa1677
    """
    if max_number <= 2:
        raise StopIteration
    yield 2
    is_prime = [1] * max_number
    square_root_of_max = max_number ** 0.5
    for number in range(3, max_number, 2):
        if is_prime[number] is 0:
            continue
        yield number
        if number <= square_root_of_max:
            for multiple in range(number * 2, max_number, number):
                is_prime[multiple] = 0

def main():
	l = LI()
	K = I()
	max_l = max(l)
 
	add_max = max_l * (2 ** K)
	print(sum(l) - max_l + add_max)


if __name__ == '__main__':
	main()

Solution (Python):
s = list(map(int, input().split()))
K = int(input())
s = sorted(s, reverse=True)
for i in range(K):
    s[0] *= 2
print(sum(s))

Solution (Python):
s = list(map(int, input().split()))
K = int(input())
s = sorted(s)
for i in range(K):
    s[2] *= 2
print(sum(s))

Solution (Python):
a,b,c = (int(i) for i in input().split())
k = int(input())
x,ans = max(a,b,c),a+b+c-max(a,b,c)
for i in range(k): x *= 2
print(ans+x)

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
mx = max(a)
print(sum(a) - mx + mx*(2**k))

Solution (Python):
numbers = [int(i) for i in input().split()] 
K = list(map(int, input().split()))[0]
max_index = numbers.index(max(numbers))
result = [numbers[i] * 2 ** K if i == max_index else numbers[i] for i in range(len(numbers))]
print(sum(result))

Solution (Python):

A, B, C = map(int, input().split())
K = int(input())

num = [A, B, C]
max_idx = num.index(max(num))

for _ in range(K):
    num[max_idx] *= 2
    
print(sum(num))

Solution (Python):

"""
Created on Sat May  5 22:10:57 2018

@author: sakas
"""

a, b, c = map(int, input().split())
K = int(input())

if a>b and a>c:
    for i in range(K):
        a *= 2
    print(a+b+c)
elif b > a and b > c:
    for i in range(K):
        b *= 2
    print(a+b+c)
else:
    for i in range(K):
        c *= 2
    print(a+b+c)

Solution (Python):

li= sorted(list(map(int, input().split(' '))),reverse=True)
  
k = int(input())

mx = li[0] * (2**k)

for i in range(1, len(li)):
                mx += li[i]
print(mx)

Solution (Python):
A, B ,C = map(int, input().split())
K = int(input())

for i in range(K):
    if A == max(A,B,C):
        A *= 2
    if B == max(A,B,C):
        B *= 2
    if C == max(A,B,C):
        C *= 2
    

print(A+B+C)

Solution (Python):
x = list(map(int,input().split()))
x = sorted(x)
k = int(input())
for i in range(k):
    x[2] *= 2
print(sum(x))

Solution (Python):
A = sorted(list(map(int, input().split())))
K = int(input())

A[-1] = A[-1]*2**K
print(sum(A))

Solution (Python):
lis = list(map(int,input().split()))
n = lis.pop(lis.index(max(lis)))
for i in range(int(input())):
    n *= 2
print(sum(lis)+n)

Solution (Python):
a, b, c = map(int, input().split())
K = int(input())

A = 0
if A < a:
    A = a
if A < b:
    A = b
if A < c:
    A = c
  
ans = a + b + c - A + A * 2**K
print(ans)

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())

mx = max(a,b,c)
other = a + b + c - mx
print (other + mx * 2 ** k)

Solution (Python):
import numpy as np

nums = np.array(list(map(int, input().split())))
K = int(input())

nums = np.sort(nums)

nums[-1] *= 2 ** K
print(np.sum(nums))

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())

m = a
count = 0
if b>m:
    m=b
    count=1
if c>m:
    m=c
    count=2

if count==0:
    print(a*2**k+b+c)
if count==1:
    print(a+b*2**k+c)
if count==2:
    print(a+b+c*2**k)