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

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

print(sum(nums))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding : utf-8

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())		# 5 7
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

M2 = M * pow(2,k)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

abc.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    values = list(map(int, input().split()))
    k = int(input())

    max_index = 0
    max_value = values[0]
    for i in range(1, len(values)):
        if max_value < values[i]:
            max_index = i
            max_value = values[i]

    del values[max_index]
    answer = sum(values) + max_value * (2 ** k)
    print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Ans=sum(X)+max(X)*(2**K)-max(X)

print(Ans)

Submission status: Accepted

Solution code:
import sys

a, b, c = map(int, sys.stdin.readline().strip().split(" "))
k = int(sys.stdin.readline().strip())

m = a
others = b + c

if m < b:
    m = b
    others = a + c
if m < c:
    m = c
    others = a + b

print(m * (2 ** k) + others)

Submission status: Accepted

Solution code:
N = map(int, raw_input().split())

K = int(raw_input())

sortN = sorted(N)

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

print(sum(sortN))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b,c = input().split()
a = int(a)
b = int(b)
c = int(c)
L = []
L.append(a)
L.append(b)
L.append(c)
L.sort(reverse=True)
K = int(input())
ans = L[0]*2**K + L[1] + L[2]
print(ans)

Submission status: Accepted

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

m = max(a)

print(sum(a) - m + m*2**k)

Submission status: Accepted

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

max_val = max(A, B, C)
answer = A + B + C - max_val + max_val * (2 ** K)

print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nums = list(map(int, input().split()))
K=int(input())
s=0
for i in nums:
  s+=i
print((2**K-1)*max(nums)+s)

Submission status: Accepted

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

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

if max(a, b, c) == a:
    print(x+b+c)
elif max(a, b, c) == b:
    print(a+x+c)
else:
    print(a+b+x)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
k = int(input())
d,e,f = sorted([a,b,c])

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://abc096.contest.atcoder.jp/tasks/abc096_b

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

K = int(input())

# print(K)

l = sorted([A, B, C])
m = l[-1]
rest = l[:-1:]

# print(m)
# print(rest)

total = m * 2 ** K + sum(rest)
print(total)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
K = int(input())
key = max([a, b, c])
ke = key
for i in range(K):
    key *= 2
print(key + a + b + c - ke)

Submission status: Accepted

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

k = int(input())

a = num2[-1]

for i in range(k):
    a = a * 2
    
num2[-1] = a
    
print(sum(num2))

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:
#! /usr/bin/env python3

import math

arr = [int(i) for i in input().split()]
k = int(input())

arr.sort()
arr.reverse()

print(arr[0] * int(math.pow(2, k)) + arr[1] + arr[2])

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

Submission status: Accepted

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

for i in range(k):
    a = sorted(a)
    a[2] = max(a) *2
    
print(sum(a))

Submission status: Accepted

Solution code:
import copy

A = input().split()
B = int(A[1])
C = int(A[2])
A = int(A[0])
K = int(input())

def dfs(L, k, ans):
    if k >= K:
        ans[0] = max(ans[0], sum(L))
        return
    for i in range(3):
        L_ = copy.deepcopy(L)
        L_[i] *= 2
        dfs(L_, k + 1, ans)

ans = [0]
dfs([A, B, C], 0, ans)
print(ans[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

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

a[np.argmax(a)] = max(a) * (2 ** k)

print(sum(a))

Submission status: Accepted

Solution code:
def abc096_b():
    import numpy as np
    abc = list(map(int, input().split()))
    k = int(input())
    num = np.max(abc)
    argnum = np.argmax(abc)
    abc.remove(abc[argnum])

    return np.sum(abc) + num * (2 ** k)


print(abc096_b())

Submission status: Accepted

Solution code:
l = sorted(list(map(int, input().split())))
k = int(input())
temp = l[-1]
for i in range(k):
  temp *= 2

print(sum(l[:2])+temp)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=[int(x) for x in input().split()]
K=int(input())
A.sort(reverse=True)
for i in range(K):
  A[0]*=2

print(sum(A))

Submission status: Accepted

Solution code:
import math

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

a=max(x)*pow(2,K)

sum=sum(x)-max(x)+a

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
List = list(map(int,input().split()))
K = int(input())
M = max(List)
ans = sum(List) - M + M * 2**K
print(ans)

Submission status: Accepted

Solution code:
# your code goes here
nums = list(map(int,input().split()))
K = int(input())

maximum = max(nums)
ans = sum(nums) - maximum + pow(2,K) * maximum
print(ans)

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= (int(i) for i in input().split()) 
k = int(input())
m = max(a,b,c)*2**k
print(a+b+c-max(a,b,c)+m)

Submission status: Accepted

Solution code:
a,b,c = list(map(int,input().split()))                                                                                                                                                                          
d = int(input())                                                                                                                                                                                                
e = max([a,b,c])                                                                                                                                                                                                
s  = sum([a,b,c])                                                                                                                                                                                                
ans = e * (2 ** d) + s -e                                                                                                                                                                                       
print(ans)

Submission status: Accepted

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

lst = list(reversed(sorted(lst)))

print(lst[0]*2**K + sum(lst[1:]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
K = int(input())

a.sort()
print(a[2] * (2 ** K) + a[0] + a[1])

Submission status: Accepted

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

t1,t2,t3 = sorted([A,B,C])
ans = t1 + t2 + (t3 * (2**K))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

    x, y, z = sorted([A, B, C])
    for i in range(K):
        z *= 2
    ans = x + y + z
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# B
a, b, c = map(int, input().split())
K = int(input())
d = (2**K - 1)*max([a, b, c])
print(a+b+c+d)

Submission status: Accepted

Solution code:
nums = list(map(int, input().split()))
K = int(input())
ans = sum(nums) - max(nums) + (max(nums) << K)
print(ans)

Submission status: Accepted

Solution code:
nums = list(map(int, input().split()))
k = int(input())
s = sum(nums)

m = max(nums)
s += m * (2**k - 1)
print(s)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(sum(a))

Submission status: Accepted

Solution code:
a, b, c=(int(w) for w in input().split())
k=int(input())
if b>a: a, b=b, a
if c>a: a, c=c, a
print((a<<k)+b+c)

Submission status: Accepted

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

b = max(a)
max_sum = b * (2 ** k) + a[0] + a[1] + a[2] - b
print(max_sum)

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

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))
a = inpl()
K = int(input())
ans = sum(a)-max(a)
temp = max(a)
for i in range(K):
    temp *= 2
print(ans+temp)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s = sorted([A, B, C])

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

print(sum(s))

Submission status: Accepted

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