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.



Sample input:
5 3 11
1


Sample output:
30

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

num.sort()

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

Submission status: Accepted

Solution code:
line = list(map(int,input().split()))
n=int(input())
line.sort()
line[2]=line[2]*(2**n)
print(sum(line))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
kk=2**k
sum=0
if a>=b and a>=c:
  sum=b+c+kk*a
elif b>=c:
  sum=a+c+kk*b
else:
  sum=a+b+kk*c
print(sum)

Submission status: Accepted

Solution code:
#coding : utf8

def maximumSum(slist):

    ABCli = list(map(int,slist[0]))
    K = int(slist[1][0])
    ABCli.sort()

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

    return sum(ABCli)


if __name__ == '__main__':
    # A=[0][0], B=[0][1], C=[0][2], D=[1][0]
    string_list = [input().split() for i in range(2)]

    print(maximumSum(string_list))

Submission status: Accepted

Solution code:
x,y,z=[int(x) for x in str(input()).split()]
k=int(input())

a=max(x,y,z)
print(x+y+z-a+2**k*a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
A, B, C = [i for i in l]
K = int(input())

max_num = max(A, B, C)
l.remove(max_num)

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

ans_num = l[0] + l[1] + max_num
print(ans_num)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
li = [a, b, c]
ol = sorted(li)
for i in range(k):
    ol[2] *= 2
print(sum(ol))

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
m_sum = A + B + C
a = max(A, B, C)
b = min(A, B, C)
c = m_sum - a - b
for i in range(K):
	m_sum += max(a, b, c)
	a *= 2
print(m_sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

integerList = [A,B,C]
arrayNum =  integerList.index(max(integerList))
integerList[arrayNum] = 2**K * integerList[arrayNum]
print(sum(integerList))

Submission status: Accepted

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

l = [A, B, C]
l.sort()
print( l[2]*(2**K) + l[1] + l[0] )

Submission status: Accepted

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

max_abc = max(ABC)
print(sum(ABC) - max_abc + max_abc * 2 ** K)

Submission status: Accepted

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

K = int(input())

numlist = [a,b,c]
numlist.sort()

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

Submission status: Accepted

Solution code:
l = list(map(int,input().split()))
k = int(input())
l.sort()
for i in range(k):
    l[2] = l[2]*2
print('{}'.format(sum(l)))

Submission status: Accepted

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

maxn = max(arr)
removed_arr = arr.remove(maxn)
calcn = maxn * pow(2, k)
arr.append(calcn)

print(sum(arr))

Submission status: Accepted

Solution code:
l = map(int, raw_input().split())
k = input()

x = max(l)
y = sum(l) - x

print x * (2 ** k) + y

Submission status: Accepted

Solution code:
a = list( map( int, input().split() ) )
a.sort( reverse = True )
limit = int( input() )

for num in range( limit ) :
    a[0] = a[0] * 2

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
k = int(input())
print(sum(l) + max(l)*((1<<k)-1))

Submission status: Accepted

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

D = min(A, B, C)
E = min(max(A, B), max(B, C), max(A, C))
F = max(A, B, C)

print(D + E + F * (2**K))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
numlist = list(map(int, input().split()))
k = int(input())

numlist.sort()
numlist[len(numlist) - 1]  *= 2 ** k
print(sum(numlist))

Submission status: Accepted

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

while K>0:
  A.sort()
  a = A.pop(-1) *2
  A.append(a)
  K-=1

print(sum(A))

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
ans = a+b+c
m = -100
if m < a: 
    m = a
if m < b: 
    m = b
if m < c: 
    m = c
ans = ans - m
for i in range(k):
    m = m*2
print(ans + m)

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
K = int(input())

l.sort()
for i in range(K):
    l[2] = 2*l[2]
    
print(l[0] + l[1] + l[2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N.sort()

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

print(N_max)

Submission status: Accepted

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

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

print(sum(a))

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

print(sum(kokuban))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
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))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = sum(num)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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)

Submission status: Accepted

Solution code:
#Maximum Sum

#入力
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)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 入力
a, b, c = map(int, input().split())
k = int(input())

# 処理
# A,B,Cをリストに格納し、最大値のみ取り出す
nums = sorted([a, b, c])
num_max = nums[2]
nums_rest = nums[:2]
# 最大値をK回2倍したものと残りの数値を足し合わせる
ans = num_max * (2 ** k) + sum(nums_rest)

# 出力
print("{}".format(ans))

Submission status: Accepted

Solution code:
#coding: utf-8

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

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

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

Submission status: Accepted

Solution code:
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())

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(input())
# スペース区切りの整数の入力
A, B, C = map(int, input().split())
# 文字列の入力
K = int(input())
# 出力
#print("{} {}".format(a+b+c, s))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding=utf-8

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

print(sum(abc))

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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