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):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b, c = sorted(Input())
    k = int(input())

    for i in range(k):
        c *= 2
    print(a+b+c)


main()

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

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

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

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

Solution (Python):
lst = input().split()
K = int(input())
for i in range(3):
   lst[i] = int(lst[i])

print(sum(lst) + (max(lst) *  ((2 ** K) - 1)))

Solution (Python):
def answer(a: int, b: int, c: int, k: int) -> int:
    nums = sorted((a, b, c))
    nums[-1] = nums[-1] * 2 ** k

    return sum(nums)


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


if __name__ == '__main__':
    main()

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

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

print(sum(A))

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

m = max(A, B, C)
print(sum([A, B, C]) - m + m * 2 ** K)

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

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

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

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):
n = list(map(int,input().split()))
k = int(input())
n.sort()
for i in range(k):
    n[2] *= 2
print(sum(n))

Solution (Python):
m, *A = sorted([int(x) for x in input().split()], reverse=True)
K = int(input())
  
print((m * 2**K) + sum(A))

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
k = int(input())
abc = [a, b, c]
abc.sort()
for _ in range(k):
    abc[-1] *= 2
print(sum(abc))

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

d=max(l)
e=d*(2**k)

l.remove(max(l))
l.append(e)

print(sum(l))

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

Solution (Python):
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
num_list = [int(num) for num in lines.pop(0).split(" ")]
k, = [int(num) for num in lines.pop(0).split(" ")]

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

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):
L = sorted(map(int, input().split()))
k = int(input())
print(L[0]+L[1]+L[2]*2**k)

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

Solution (Python):
l = list(map(int, input().split()))
k = int(input())
num = max(l)
l.remove(num)
for i in range(k):
    num = num * 2
print(sum(l) + num)

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

M=sorted([A,B,C])
m=M[-1]

m=m*2**K

print(m+M[0]+M[1])

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

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

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

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

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

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

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

Solution (Python):
num1, num2, num3 = map(int, input().split())
count = int(input())

max_num = max(num1, max(num2, num3))

sum_num = num1 + num2 + num3 - max_num
end_num = max_num
for i in range(count):
    end_num *= 2

print(sum_num + end_num)

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

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

Solution (Python):
n = [int(s) for s in input().split()]
k = int(input())

for i in range(k):
    max_id = n.index(max(n))
    n[max_id] *= 2
print(sum(n))

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

_sum = []
_max = max(A, B, C)
remaining = [r for r in [A, B, C] if r != _max]
if len(remaining) == 0:
    remaining = [_max, _max]
if len(remaining) == 1:
    remaining.append(_max)

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

print(_max + sum(remaining))

Solution (Python):






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




f.sort(reverse=True)
for i in range(K):
    f[0]*=2
print(sum(f))

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

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=list(map(int,input().split()))
K=int(input())

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

Solution (Python):
import math




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

s=int(input())

for i in range(s):
	a[a.index(max(a))]=	a[a.index(max(a))]*2
	
print(sum(a))

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

max_num = max(A,B,C)
if A == max_num:
  print(A * (2 ** K) + B + C)
elif B == max_num:
  print(B * (2 ** K) + A + C)
else:
  print(C * (2 ** K) + B + A)

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

print(max(ABC)*(2**K - 1) + sum(ABC))

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

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

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

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):
display = sorted(list(map(int, input().split())))
K = int(input())

maximum = display[-1]
for i in range(K):
    maximum = maximum*2



print(sum(display[:-1])+maximum)

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

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

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

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

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


if __name__ == "__main__":
    main()

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

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

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

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

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

a,b,c= sorted([a,b,c])
print(a+b+c*2**n)

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

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

Solution (Python):
a = sorted(list(map(int, input().split())))
m = a.pop()
for i in range(int(input())):
  m *= 2
print(sum(a) + m)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    x = list(map(int, readline().split()))
    K = int(readline())
    x.sort(reverse=True)

    ans = x[0] * 2 ** K + x[1] + x[2]
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
l=[int(x) for x in input().split()]
k=int(input())
m=max(l)
l.remove(max(l))
for i in range(k):
    m *= 2 
print(sum(l)+m)

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

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

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

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

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

ABC = sorted(ABC)

ret = ABC[2]
for i in range(K):
    ret = ret * 2

ret += sum(ABC[:2])

print(ret)

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

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

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

Solution (Python):
abc = list(map(int, input().split()))
k = int(input())
mx = abc.pop(abc.index(max(abc)))
print(mx * pow(2, k) + sum(abc))

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

x=max(a,b,c)

print((a+b+c)-x+x*(2**k))

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

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

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

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

for i in range(k):
  m *= 2
  
print(sum([a, b, c]) - max(a, b, c) + m)

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

Solution (Python):
A,B,C = map (int, input ().split ())
S = int (input ())
if A>B>C or A>C>B:
  for i in range (S):
    A = A*2
  print (A+B+C)
elif B>A>C or B>C>A:
  for i in range (S):
    B = B*2
  print (A+B+C)
else:
  for i in range (S):
    C = C*2
  print (A+B+C)

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

a.sort()

print(sum(a[:-1]) + a[-1] * 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, input().split())
k = int(input())

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

Solution (Python):
l = list(map(int, input().split()))
k = int(input())
i = l.index(max(l))
m = l[i]
del l[i]
l.append(m * 2 ** k)
print(sum(l))

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

for i in range(k):
  abc.sort()
  abc[2] *= 2
  
print(sum(abc))

Solution (Python):
A,B,C=map(int,input().split())
D=[A,B,C]
a=0
K=int(input())
a+=(max(D)*(2**K))
D.remove(max(D))
for i in range(2):
    a+=D[i]
print(a)

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

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

max = 0
index = -1
for i in num_list:
    if max < i:
        max = i
        index = num_list.index(i)

change = max*(2**k)
num_list[index] = change
ans = 0
for j in num_list:
    ans += j

print(ans)

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

a.sort()
a[-1] *= 2 ** k

print(sum(a))

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    ABC = LI()
    K = I()
    ABC.sort()

    ans = sum(ABC[:2]) + ABC[2] * 2 ** K
    print(ans)

if __name__ == '__main__':
    resolve()

Solution (Python):



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


abc.sort()

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

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

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

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

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

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

print(A+B+C)

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

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

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

abc.sort(reverse=True)

abc[0] = abc[0] * (2 ** k)

print(sum(abc))

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

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

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):
LI = lambda: list(map(int, input().split()))

A, B, C = LI()
K = int(input())


def main():
    l = [A, B, C]
    l.sort()
    l[-1] *= 2 ** K
    ans = sum(l)
    print(ans)


if __name__ == "__main__":
    main()

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

m = max(A, B, C)
m *= 2**K

ans = A + B + C - max(A, B, C)
ans += m
print(ans)

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

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

print(sum(abc))

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

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

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

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):
ls = list(map(int,input().split()))
K = int(input())
ls.sort()
ans = ls[0]+ls[1]+ls[2]*2**K
print(ans)

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

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

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

print(sum(lst))

Solution (Python):
a = list(map(int, input("").split()))
k=int(input())
m=0
if a[1] >= a[0] or a[2] >= a[0]:
    if a[2] >= a[1]:
        m=2
    else:
        m=1
for i in range(k):
    a[m]=a[m]*2
print(a[0]+a[1]+a[2])

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

print(sum(num))

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

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

m = max(a,b,c)

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

ans = a+b+c+m-max(a,b,c)

print(ans)

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):
abc = list(map(int, input().split()))
k = int(input())
mx = max(abc)
x2 = mx
for i in range(k):
    x2 *= 2
print(x2 + sum(abc) - mx)

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

    l = [A, B, C]
    l.sort(reverse=True)
    for i in range(K):
        l[0] = l[0] * 2
    print(sum(l))
main()

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = rl()
max_ = max(li)
k = ri()
li.remove(max_)
print(sum(li) + max_ * 2**k)

Solution (Python):









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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A = list(map(int, readline().split()))
    K = int(readline())

    A.sort()
    for _ in range(K):
        A[-1] *= 2

    print(sum(A))

    return


if __name__ == '__main__':
    main()

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

print(A + B + C * 2**K)

Solution (Python):
a=sorted(map(int,input().split()))[::-1];print(a[0]*(2**(int(input())))+sum(a)-a[0])

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

Solution (Python):
a=sorted(map(int,input().split()));k=int(input())
for i in range(1,k+1): a[-1]*=2
print(sum(a))

Solution (Python):
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
X = list(map(lambda x: int(x), input().split(" ")))
K = int(input())

X.sort()

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

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

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

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    A, B, C = map(int, readline().split())
    K = int(readline())
    print(max(A, B, C) * 2**K + A+B+C-max(A,B,C))


if __name__ == '__main__':
    main()

Solution (Python):
input_ = [int(s) for s in input().split()]
k = int(input())
input_.sort(key=int)
for _ in range(k):input_[2] *= 2
ans = 0
for i in range(3):ans += input_[i]
print(ans)

Solution (Python):

abc=list(map(int,input().split()))
k=int(input())
print(sum(abc)-max(abc)+max(abc)*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):
def solve():
  A, B, C = map(int, input().split())
  K = int(input())
  ans = A+B+C+max([A,B,C])*(pow(2,K)-1)
  return ans
print(solve())

Solution (Python):
data = list(map(int, input().split()))
k = int(input())
if k == 1:
    print( sum(data) + max(data) )
else:
    tmp = max(data)
    for _ in range(k):
        tmp = tmp * 2
    print( sum(data) + tmp - max(data) )

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

ans = sum(A) + max(A)*(2**K-1)

print(ans)

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

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

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())

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

Solution (Python):

















import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

import math

X = sorted(MAP())
K = INT()
ans = X[0] + X[1]
ans += X[2] * math.pow(2, K)
print(int(ans))

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

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

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

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

ABC = [a, b, c]
sort_ACB = sorted(ABC)
MAX = sort_ACB[-1]
sum_ABC = sum(ABC) - MAX

for _ in range(k):
  MAX*=2
print(sum_ABC + MAX)

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

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


for i in range(K):
    sl[-1] *= 2


print(sum(sl))

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

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):
a, b, c = sorted(list(map(int, input().split())))
k = int(input())
print(a + b + c * (2 ** k))

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

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






max_index = abc.index(max(abc))

for _ in range(k):
    abc[max_index] = abc[max_index] * 2


print(sum(abc))

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
    elif (b == max(a, b, c)):
        b *= 2
    else:
        c *= 2

print(a + b + c)

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

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

Solution (Python):
s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])

v = input()
k = int(v)

max_index = 0

array = []
array.append(a)
array.append(b)
array.append(c)


for i in range(k):
    array.sort()
    x = array.pop()
    x *= 2
    array.append(x)


answer = 0
for i in range(len(array)):
    answer += array[i]

print(answer)

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):
List = list(map(int, input().split()))
List.sort()
K=int(input())
for i in range(K):
  List[2] = List[2]*2
wa = 0
for i in range(3):
  wa += List[i]
print(wa)

Solution (Python):
MM = input().split()
A = int(MM[0])
B = int(MM[1])
C = int(MM[2])
K = int(input())
S = [A,B,C]
S.sort()

S[-1] = S[-1] * 2 ** K

total =0
for i in S:
  total += i
print(total)

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):

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

ini = [A,B,C]
from itertools import permutations, combinations,combinations_with_replacement,product
a=['A','B','C']
Ls = list(combinations_with_replacement(a,K))

ans=0
for L in Ls:
    ini=[A,B,C]
    
    
    for i in L:
        
        if i=='A':
            ini[0]*=2
        elif i=='B':
            ini[1]*=2
        elif i=='C':
            ini[2]*=2
    ans=max(ans,sum(ini))
    

print(ans)

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

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

ans = sum([A,B,C]) - max(A,B,C) + max(A,B,C)*pow(2,K)

print(ans)

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):
l = list(map(int, input().split()))
k = 2**int(input())
print((sum(l)-max(l))+ max(l)*k)

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

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, c, k = map(int, read().split())
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())
a.sort()
print(sum(a[0:2])+a[2]*(2**k))

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

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

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

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

Solution (Python):
Num = sorted([int(X) for X in input().split()])
K = int(input())
print(Num[0]+Num[1]+Num[2]*pow(2,K))

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


if __name__ == "__main__":
    solve()

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

print(sum(a[:2])+a[-1]*2**k)

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

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

for k in range(K):
  C*=2
  
print(A+B+C)

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

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

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

if __name__ == "__main__":
    main()

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

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    ABC = il()
    N = ii()
    m = max(ABC)
    for n in range(N):
        m*=2
    print(sum(ABC) + m - max(ABC))


if __name__ == '__main__':
    main()

Solution (Python):
import math
def main():
  a,b,c = list(map(int,input().split()))
  k = int(input())
  if a<b:
    if b<c:
      print(a+b+c*pow(2,k))
    else:
      print(a+b*pow(2,k)+c)
  else:
    if a<c:
      print(a+b+c*pow(2,k))
    else:
      print(a*pow(2,k)+b+c)
main()

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