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):
a = [int(i) for i in input().split()]
k = int(input())
print(max(a)*(2**k)+sum(a)-max(a))

Solution (Python):



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


num_list.sort()

num_tmp = num_list[2]

for i in range(times):
	num_tmp = num_tmp * 2
num_list[2] = num_tmp


print(sum(num_list))

Solution (Python):
l=list(map(int,input().strip().split()))
k=int(input())
l=sorted(l)[::-1]
while k>0:
    l[0]=l[0]*2
    k-=1
print(sum(l))

Solution (Python):
num = input()
num = num.rstrip().split(" ")
if int(num[0])>=10:
    num[0]=num[0]
else:
    num[0]="0"+str(num[0])
if int(num[1])>=10:
    num[1]=num[1]
else:
    num[1]="0"+str(num[1])
if int(num[2])>=10:
    num[2]=num[2]
else:
    num[2]="0"+str(num[2])


list1 = [int(num[0]),int(num[1]),int(num[2])]
list1 = sorted(list1)

count= input()

print(int(list1[2]*(2**int(count))+list1[1]+list1[0]))

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

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

x = max([A,B,C])
print(str(A + B + C + x * (2 ** K - 1)))

Solution (Python):

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

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

Solution (Python):
a = map(int, raw_input().split())

N = input()

b = sorted(a)
b.reverse()

k = b[0]

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


for i in range(len(a)-1):
    k = k + b[i+1]

ans = k

print(ans)

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

a.sort()
print('{}'.format(a[0] + a[1] + a[2] * (2 ** K)))

Solution (Python):
a=map(int,raw_input().split())
k=int(raw_input())
n=max(a)
a.remove(n)
print("%d"%(n*2**k+sum(a)))

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

max_num = max(number)
number.remove(max_num)

max_num = max_num * (2 ** k)

print(sum(number)+max_num)

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

res=max(A)*2**K+sum(A)-max(A)
print(res)

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

M=max(L)
L.remove(M)



for i in range(K):
    M=M*2
    
ans=0

ans=M+sum(L)

print(ans)

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

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

list = [a, b, c]
max = max(list)
index_max = list.index(max)

result = max * 2 ** k
for i in range(3):
	if i != index_max:
		result += list[i]

print(result)

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

Solution (Python):

a, b, c = map(int, input().split())
k = int(input())
if(a > b and a > c):
    for aa in range(k):
        a = a * 2
elif(b > a and b > c):
    for bb in range(k):
        b = b * 2
else:
    for cc in range(k):
        c = c * 2
print(a+b+c)

Solution (Python):
a = input().split(" ")
K = int(input())
max = 0
k = 0
for i in range(3):
    if int(a[i]) >= max:
        max = int(a[i])
        k = i
a[k] = int(a[k]) * (2 **K)
print(int(a[0])+int(a[1])+int(a[2]))

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

s = sum([a, b, c])
s -= max([a, b, c])
s += 2 ** k * max([a, b, c])

print(s)

Solution (Python):
blackboard = map(long, raw_input().split())
K = long(raw_input())
blackboard.sort()
blackboard.reverse()
ans = blackboard[0]*(2**K)+blackboard[1]+blackboard[2]
print ans

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


for i in range(K):
    if A >= B and A >= C:
        A = A*2

    if B > A and B >= C:
        B = B*2

    if C > B and C > A:
        C = C*2


sum = A + B + C

print(sum)

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

m = max(A)
idx = A.index(m)

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

result = 0
for i in range(3):
    if i == idx:
        result += m
    else:
        result += A[i]
print(result)

Solution (Python):
d = list(map(int, input().split(' ')))
k = int(input())
m = max(d)
d.remove(m)
for iter_count in range(k):
    m *= 2
print(sum(d) + m)

Solution (Python):
n = input().split()

k=int(input())
n = [int(n[0]), int(n[1]),int( n[2])]
n.sort()

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


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

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

for _ in range(k):
    n_max = max(n)
    n_max = n_max * 2
    n[n.index(max(n))] = n_max

print(sum(n))

Solution (Python):
import math

s = input().rstrip().split()

a = int(s[0])
b = int(s[1])
c = int(s[2])

k = int(input())

m = max(a,b,c)

n = math.pow(2,k)

ans = a + b + c + m*(n-1)

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

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

K = int(input())

maxNumber = max(List)
List.remove(maxNumber)
print(maxNumber* pow(2, K) + List[0] + List[1])

Solution (Python):

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

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

Solution (Python):





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

if b <= c:
    b,c=c,b
if a <= b:
    a,b = b,a
print(a*(2**K)+b+c)

Solution (Python):


a,b,c = map(int, raw_input().split())
d=[a,b,c]

k = int(raw_input())

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

Solution (Python):
numbers = input().split()
A = int(numbers[0])
B = int(numbers[1])
C = int(numbers[2])

K = int(input())

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

print(A + B + C)

Solution (Python):
ABC = sorted(map(int,raw_input().split()))
for x in range(input()):
	ABC[2] = ABC[2]*2
print ABC[2]+ABC[0]+ABC[1]

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

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

Solution (Python):
def ii():
    return int(input())

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







a, b, c = lii()
k = ii()

for _ in range(k):
    if a == max(a, b, c):
        a *= 2
    elif b == max(a, b, c):
        b *= 2
    elif c == max(a, b, c):
        c *= 2

print(sum([a, b, c]))

Solution (Python):

if __name__ == "__main__":
    A, B, C = list(map(int, input().split()))
    K = int(input())
    l = [A, B, C]
    l.sort()
    ans = l[2] * (2**K) + l[0] + l[1]
    print(ans)

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

Solution (Python):
s = list(map(int, input().split()))
k = int(input())
mx = max(s)
ind = s.index(mx)
sm = sum(s[:ind])+sum(s[ind+1:])
sm+=mx*2**k
print(sm)

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

m = max(a)
s = m

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

print(sum(a) - m + s)

Solution (Python):
import numpy as np

nums = np.array([int(item) for item in input().split(' ')])
k = int(input().split(' ')[0])

for i in range(1,k+1):
    maxi = nums.argmax()
    nums[maxi] = nums[maxi] * 2

print(sum(nums))

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

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

Solution (Python):
a, b, c = map(int, input().split())  
k = int(input())  
num_ary = [a, b, c]
max_n = max(num_ary)

max_index = num_ary.index(max_n)

max_num = max_n * pow(2, k)

num_ary[max_index] = max_num

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

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

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

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

maximun = max(ABC)
index = 0
for i in range(3):
    if ABC[i] - maximun == 0:
        index = i

for k in range(K):
    ABC[index] = 2 * ABC[index]

print(sum(ABC))

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

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

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

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

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

l.sort()
l[2] = l[2] * (2**k)
print(sum(l))

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

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

max_abc = max(abc)
sum_abc = sum(abc)

print(sum_abc - max_abc + max_abc*(2**k))

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

Solution (Python):
import math
import random
import heapq
from collections import Counter, defaultdict
from decimal import Decimal, ROUND_HALF_UP, ROUND_CEILING
from functools import lru_cache, reduce
from itertools import combinations_with_replacement, product, combinations


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input()


def read_str_n():
    return list(map(str, input().split()))


def mt(f):
    import time
    import sys

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        print(e - s, 'sec', file=sys.stderr)
        return ret

    return wrap


@mt
def slv(A, B, C, K):

    ans = sum([A, B, C])
    m = max([A, B, C])
    ans -= m
    for i in range(K):
        m *= 2
    return ans + m


def main():
    A, B, C = read_int_n()
    K = read_int()
    print(slv(A, B, C, K))


if __name__ == '__main__':
    main()

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

M = max(A, B, C)

SUM = M*(2**K)


if M == A:
	ADD=(B+C)
elif M == B:
	ADD=(A+C)
elif M == C:
	ADD=(A+B)

print(SUM+ADD)

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

print(l[2]*2**k + l[0] + l[1])

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

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

L.sort()

print(sum(L) + L[len(L) - 1] * (2 ** K - 1))

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

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

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

Solution (Python):
a = [int(i) for i in input().split()]
K=int(input())
M = max(a)
y = pow(2,K)
B=M*y
result = sum(a) + B - M
print(result)

Solution (Python):
def main(a, b, c, k):
  abc = sorted([a, b, c])
  abc[-1] *= 2**k
  print(sum(abc))









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

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

Solution (Python):
if __name__ == '__main__':
	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 numpy as np

x, y, z = map(int, input().split(' '))
row = np.array([x, y, z])

for times in range(int(input())):
    row[row.argmax()] = row.max() * 2
    
print(np.sum(row))

Solution (Python):


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

 

 
 
l = sorted([a,b,c])
m=l[2]
 
for i in xrange(k):
    m *= 2

print m + l[0] + l[1]

Solution (Python):


li = list(map(int,raw_input().split()))
time = int(raw_input())
max_num = max(li)
print sum(li) - max_num + max_num*(2** time)

Solution (Python):
import sys

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

flag = True

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

    flag = False
    print(a+b+c)

if max([a, b, c]) == b and flag:
    for i in range(k):
        b = b*2

    flag = False
    print(a+b+c)

if max([a, b, c]) == c and flag:
    for i in range(k):
        c = c*2

    print(a+b+c)

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

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

print(sum(list))

Solution (Python):
import sys
sys.setrecursionlimit(10000)

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

ans = []

for i in range(0, k+1, 1):
    for j in range(0, k-i+1, 1):
        ans.append(a*(2**i) + b*(2**j) + c*(2**(k-i-j)))

print(max(ans))

Solution (Python):

blackboard = list(map(int, input().split(" ")))
K = int(input())

for _ in range(K):
    maximum = max(blackboard)
    ind_max = blackboard.index(maximum)
    blackboard[ind_max] = maximum * 2


print(sum(blackboard))

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

for i in range(k):
  a_list = sorted(a_list, reverse=True)
  a_list[0] = max(a_list) * 2
  
print(sum(a_list))

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

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


def dp(a,b,c,k):
    if k == 0:
        return a+b+c
    elif k == 1:
        return max(a,b,c) + a+b+c
    else:
        if max(a,b,c) == a:
            return dp(2*a, b, c, k-1)
        elif max(a, b, c) == b:
            return dp(a, 2*b, c, k - 1)
        else:
            return dp(a, b, 2*c, k - 1)


print(dp(A,B,C,K))

Solution (Python):
abc_list = list(map(int, input().split()))
K = int(input())
abc_list.sort()
m_v = abc_list.pop()

for i in range(K):
    m_v *= 2
abc_list.append(m_v)
print(sum(abc_list))

Solution (Python):


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

l.sort(reverse=True)
m = max(l)
for _ in range(k):
    m *= 2

ans = m
for i in range(1, len(l)):
    ans += l[i]
print(ans)

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

K = int(input()) 
temp = max(ABC)
temp_index=ABC.index(temp)
del ABC[temp_index]
ans = temp*2**K
ans += sum(ABC)

print(ans)

Solution (Python):
listA=list(map(int,input().split()))
K=int(input())
listA=sorted(listA)
ans=(2**K)*listA[-1]+sum(listA[:-1])
print(ans)

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

Solution (Python):
def main():
    n = list(map(int, input().split()))
    k = int(input())

    n.sort(reverse=True)
    r = n[0] * (2 ** k) + n[1] + n[2]
    print(r)

main()

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

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

nums = sorted([a,b,c],reverse=True)
nums[0] *= (2 ** k)

print(sum(nums))

Solution (Python):
a, b, c = (int(i) for i in input().split())
d = int(input())
max_a = max(a,b,c)

ans = a + b + c + max_a * pow(2 , d) - max_a
print(ans)

Solution (Python):
import sys
 
l1 = sys.stdin.readline()
l2 = sys.stdin.readline()
 
nums = [int(x) for x in l1.rstrip('\n').split(' ')]
l2 = int(l2)
 
out = max(nums)
 
for i in xrange(l2):
  out *= 2
print out + sum(nums) - max(nums)

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):
ABC=list(map(int, input().rstrip().split()))
K=int(input())
ABC.sort()
ABC.reverse()
ABC[0]=ABC[0]*2**K
print(sum(ABC))

Solution (Python):
num = list(map(int,input().split()))
k = int(input())
sort_num = sorted(num)
sort_num[-1] = sort_num[-1] * (2**k)
print(sum(sort_num))

Solution (Python):
Tmp = []
Tmp = input().rstrip().split(' ')

A = int(Tmp[0])
B = int(Tmp[1])
C = int(Tmp[2])

N = int(input())
Max = A
Tmp1 = B
Tmp2 = C
TmpN = 0

if Max < B:
    Tmp1 = Max
    Max = B

if Max < C:
    Tmp2 = Max
    Max = C

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

TmpN = Max + Tmp1 + Tmp2

print(TmpN)

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
if a >= b and a >= c:
    d = a
    e = b
    f = c
if b >= a and b >= c:
    d = b
    e = a
    f = c
else:
    d = c
    e = a
    f = b

print (e + f + d * 2 ** k)

Solution (Python):


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

maxN = 0
maxIndex = 0
for i, n in enumerate(N):
    if n > maxN:
        maxN = n
        maxIndex = i

ans = sum(N) + maxN * 2**K - maxN

print(ans)

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

for i in range(K):
    if 2*A > (B + C):
        A = A * 2
    elif 2*B > (A + C):
        B = B * 2
    elif 2*C > (B + A):
        C = C * 2
    elif A == B == C:
        A = A * 2

print(A+B+C)

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

Solution (Python):

arr = list(map(int, input().split()))
arr.sort()
k = int(input()) 

arr[2]*=(2**k)

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

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
x = a[0]+a[1]+a[2]-max(a)
y = pow(2,k)
print(x+y*max(a))

Solution (Python):
A,B,C = map(int,input().split())
a = [A,B,C]
K = int(input())
abcMax = a.index(max(a))
for i in range(K):
    a[abcMax] = a[abcMax] * 2
print(sum(a))

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

num = sorted([a,b,c])
max_num = num[-1]
other_sum = sum(num[:2])
ans =  ((2**k)*max_num) + other_sum 

print(ans)

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
m = []
m.append(a)
m.append(b)
m.append(c)
m = sorted(m)
print(m[0]+m[1]+m[2]*(2**k))

Solution (Python):
import math

nums = sorted(list(map(int, input().split(' '))))

K = int(input())

result = nums[0] + nums[1] + nums[2] * math.pow(2, K)

print(int(result))

Solution (Python):
inp = [int(_) for _ in input().split()]
k = int(input())

inp.sort()
n = inp.pop()
for i in range(k):
    n = n*2
print(n + sum(inp))

Solution (Python):
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
k = int(input())
d = list()
d.append(a)
d.append(b)
d.append(c)
for i in range(k):
    d = sorted(d)
    e = d.pop()
    d.append(2 * e)
    
ans = 0
n = len(d)
for _ in range(n):
    ans += d.pop()
print(ans)

Solution (Python):
ABC = list(map(int,input().split()))
K = int(input())
for i in range(K):
    max_ABC = max(ABC) * 2
    ABC = sorted(ABC)
    ABC.pop()
    ABC.append(max_ABC)
print(sum(ABC))

Solution (Python):


import math
import sys
import itertools
import numpy as np

a,b,c = map(int, input().split())
k = int(input())
sum_3 = a+b+c
n=a
if  n < b:
    n = b
if n < c:
    n = c
answer = n
for i in range(k):
    answer = answer * 2
answer = answer + sum_3 - n
print(answer)

Solution (Python):

"""
Created on Sat May  5 20:55:26 2018
ABC096-2
@author: maezawa
"""

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

m = max(a)
ans = m * 2**k +sum(a) - m

print(ans)

Solution (Python):

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

list_abc.sort()
print(list_abc[0]+list_abc[1]+list_abc[2]*(2**k))

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

m_i = nums.index(max(nums))

for i in range(k):
    nums[m_i] *= 2

print(sum(nums))

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

if max(a, b, c) == a:
    for i in range(k):
        a *= 2
elif max(a, b, c) == b:
    for i in range(k):
        b *= 2
elif max(a, b, c) == c:
    for i in range(k):
        c *= 2

print(a+b+c)

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

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

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

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

Solution (Python):
import itertools as it
N = list(map(int, input().split()))
K = int(input())
ans = 0

for i in it.product(list(range(3)), repeat = K):
    T = N.copy()
    for k in range(K):
        T[i[k]] *= 2
    if ans <= sum(T):
        ans = sum(T)
print(ans)

Solution (Python):
a=map(int, raw_input().split())
K=input()
max_a=max(a)
x=max_a*(2**K)

ans=x

a.remove(max_a)
for i in a:
	ans+=i
print ans

Solution (Python):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a = Is()
k = I()
print(sum(a)-max(a) + max(a)*(2**k))

Solution (Python):
a = [int(i) for i in input().split()] 
n = int(input())
a.sort()

for i in range(n):
    a[-1] = a[-1]*2

print(sum(a))

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

Solution (Python):
a, b, c = list(map(int, input().split(' ')))
N = int(input())
max_ = max([a, b, c])
print(a+b+c+max_*(2**N)-max_)

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 >= a and  b >= c:
    print(a + b*(2**k) + c)
else :
    print(a + b + c*(2**k))

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

x = max(a,b,c)

y = x * (2**k)

if x==a:
	print(y+b+c)
	exit(0)
if x==b:
	print(a+y+c)
	exit(0)
if x==c:
	print(a+b+y)
	exit(0)

Solution (Python):
a = sorted([int(i) for i in input().split()], reverse=True)
n = int(input())
a = [a[0] * (2 ** n)] + a[1:]
print(sum(a))

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

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

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

Solution (Python):


a = list(map(int, input().split()))
K = int(input())

max_sum = max(a)
for i in range(0,K):
    max_sum = max_sum*2

check = 0
for i in a:
    if i == max(a):
        if check == 0:
            check = 1        
        else:
            max_sum = max_sum + i
    else:
        max_sum = max_sum + i

print(max_sum)

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):
a, b, c = map(int, input().split())
k = int(input())
m = max(a, b, c)
if a == max(a, b, c):
    tmp = b + c
elif b == max(a, b, c):
    tmp = a + c
else:
    tmp = a + b

for i in range(k):
    m *= 2
print(m + tmp)

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

Solution (Python):
A,B,C=map(int,input().split())
K=int(input())
list=[A,B,C]
presum=A+B+C-max(list)
i=0
preanswer=max(list)
while i<K:
    preanswer=preanswer*2
    i+=1
print(preanswer+presum)

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

M = max([a,b,c])


M2 = M * pow(2,k)

print(a+b+c+M2-M)

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

a = na()
a.sort()
k = ni()

print(a[2]*2**k + a[1] + a[0])

Solution (Python):


input_num = input().split(" ")
a = int(input_num[0])
b = int(input_num[1])
c = int(input_num[2])
k = int(input())

output = 0
maxnum = max([a,b,c])
new_list = [a,b,c]
new_list.remove(maxnum)
for i in new_list:
    output += i

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

output += maxnum

print(output)

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

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):
from sys import stdin


def main():
    ABC = sorted([int(x) for x in stdin.readline().rstrip().split()])
    K = int(stdin.readline().rstrip())
    for i in range(K):
        ABC[-1] *= 2
    print(sum(ABC))


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    a, b, c = input().split()
    k = input()

    a = int(a)
    b = int(b)
    c = int(c)
    lst = [a,b,c]
    k = int(k)


    M = max(lst)
    lst.remove(M)

    for i in range(k):
        M = M * 2
    ans = sum(lst) + M

    print(ans)

if __name__ == "__main__":
        main()

Solution (Python):
import re
inp = re.split(" ",input())
k = int(input())

for i in range(len(inp)):
    inp[i] = int(inp[i])

for i in range(k):
    inp.sort()
    inp.reverse()
    inp[0] *= 2

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

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

Solution (Python):
a,b,c = map(int, input().split())
k = int(input())
for n in range(k):
    if max(a,b,c)==a:
        a*=2
    elif max(a,b,c)==b:
        b*=2
    elif max(a,b,c)==c:
        c*=2
print(a+b+c)

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

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

Solution (Python):

a, b, c = map(int, input().split(" "))
n = int(input())
result = 0

result = max(a,b,c) * (2 ** n) + a + b + c - max(a,b,c)

print(result)

Solution (Python):
d = list(map(int,input().split()))
a = int(input())
d.sort()
k = len(d)
for i in range(a):
  d[k-1] += max(d)
print(sum(d))

Solution (Python):
a = list(map(int, input().split()))
k = int(input())
b=max(a)
if(a[0] == b):
    a[0] *= 2 ** k
elif a[1] == b:
    a[1] *= 2 ** k
else:
    a[2] *= 2 ** k
print(sum(a))

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

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

if __name__ == '__main__':
    print(main())

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
sumabc = sum([a, b, c])
maxabc = max([a, b, c])
for i in range(k):
    maxabc *= 2

print(sumabc + maxabc - max([a, b, c]))

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

m = max(abc)
abc.remove(m)

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

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

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

max_num = max(a,b,c)

others = a+ b+ c-max_num

ret = max_num * 2 ** k + others
print(ret)

Solution (Python):
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
x=i2()
k=i1()
import heapq
z=[-i for i in x]
heapq.heapify(z)
for i in range(k):
 y=heapq.heappop(z)
 heapq.heappush(z,2*y)
print(-sum(z))

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

max_bord=max(A,B,C)*2**K
print(defalt+max_bord)

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

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

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

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

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

K = int(input())

if A>B and A>C:
    A = A * (2**K)
elif B>A and B>C:
    B = B * (2**K)
else:
    C = C * (2**K)

print(A+B+C)

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

Solution (Python):
a,b,c = map(int,input().split())
k = int(input())
if(a >= b):
    if(a >= c):
        for i in range(k):
            a = a*2
    else :
        for i in range(k):
            c = c*2
else :
    if(b >= c):
        for i in range(k):
            b = b*2
    else:
        for i in range(k):
            c = c*2
print(a+b+c)

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

abc.sort()

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

Solution (Python):
A, B, C = map(int, input().split())
K = int(input())
M = 0
if (A >= B) and (A >= C):
    M = B + C + ( A * ((2)**K))
elif (B > A) and (B >= C):
    M = A + C + (B * ((2)**K))
else:
    M = B + A + (C * ((2)**K))
print(M)

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

c = lm[2]
lm.remove(c)

for i in range(k):
    c = c * 2
    
print(lm[0] + lm[1] + c)