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

v.sort()
for _ in range(k):
    v[-1] *= 2
print(sum(v))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

abc.sort()

abc[2] = abc[2]*2**k
print(sum(abc))

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())
m=max(a,max(b,c))
n=m
for _ in range(k):
    m = m * 2
print(a+b+c+m-n)

Submission status: Accepted

Solution code:

import math

ary = list(map(int, input().split()))
i = int(input())


x_ = max(ary)
sum_ = sum(ary)-x_
#print(sum_)
print ( sum_ + int(x_*math.pow(2,i)) )

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
k = int(input())
a.sort()
print(a[len(a)-1]*2**k+sum(a)-a[len(a)-1])

Submission status: Accepted

Solution code:
a, b, c = [int(i) for i in input().split()]
k = int(input())
m = max(a, b, c)
print(a + b + c + m*(2 ** k) - m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=[int(i) for i in input().split()]
b=int(input())
print(sum(a)-max(a)+max(a)*2**b)

Submission status: Accepted

Solution code:
# Maximum Sum
nums = tuple(map(int, input().split()))
print(max(nums)*(2**int(input()))+sum(nums)-max(nums))

Submission status: Accepted

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


def solve():
    bb = list(map(int, input().split()))
    K = int(input())

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

from itertools import product

l = []

for t in product(range(3),repeat=k):
    bd = [a,b,c]
    for i in range(k):
        bd[t[i]]*=2
    l.append(sum(bd))
print(max(l))

Submission status: Accepted

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

A=[a,b,c]
A=sorted(A)
print(A[0]+A[1]+A[2]*2**z)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
abc = [int(_) for _ in input().split()]
K = int(input())
print(max(abc) * 2 ** K + sum(abc) - max(abc))

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:
A, B, C = [int(_) for _ in input().split()]
K = int(input())

a, b, c = sorted([A, B, C])

result = a + b + c * (2**K)

print(result)

Submission status: Accepted

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

ABC.sort()

print(ABC[0]+ABC[1]+ABC[2]*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:
a,b,c = list(map(int, input().split()))
k = int(input())
m = max(a,b,c)
l = m
for i in range(k):
    l *= 2
print(sum([a,b,c])-m+l)

Submission status: Accepted

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

Submission status: Accepted

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

print(b*(2**k) + sum(a))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

word.sort()
word[2] = word[2] * (2 ** k)

print(sum(word))

Submission status: Accepted

Solution code:
L = sorted(list(map(int,input().split())))
K = int(input())
L[2] = L[2]*(2**K)
print(sum(L))

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
K=int(input())
A,B,C=sorted([A,B,C],reverse=True)

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

print(A+B+C)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

a = list(li())
k = ni()
a.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
l = [A,B,C]
l.sort()
t = l[-1]
for i in range(K):
    t *= 2
print(l[0]+l[1]+t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = [int(i) for i in input().split()]
K = int(input())
N = sorted(N)
print(N[2]*(2**K)+N[0]+N[1])

Submission status: Accepted

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

t = max(a, b, c)

u = t * (2 ** k)

if t == a:
    print(u + b + c)
elif t == b:
    print(u + a + c)
elif t == c:
    print(u + a + b)

Submission status: Accepted

Solution code:
def run(A, B, C, K):
    if A > B:
        if A > C:
            ret = A*(2**K) + B + C
        else:
            if B > C:
                ret = B*(2**K) + A + C
            else:
                ret = C*(2**K) + A + B
    else:
        if B > C:
            ret = B*(2**K) + A + C
        else:
            ret = C*(2**K) + A + B
    return ret


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n = list(map(int, input().split()))
k = int(input())
n.sort()
num = n[2]
for i in range(0,k):
  num = num * 2

print(num+n[0]+n[1])

Submission status: Accepted

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

for i in range(K):
    A, B, C = sorted(D)
    D = [A, B, C*2]
print(sum(D))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=[int(i) for i in input().split()]
k=int(input())
ans=chk=0
for i in range(3):
    tmp=l[i]
    for j in range(k):
       tmp*=2
    ans=max(ans,sum(l)+tmp-l[i])
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

ABC.sort()
ABC[-1] = max(ABC)*2**K
print(sum(ABC))

Submission status: Accepted

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

Submission status: Accepted

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

ABC2 = sorted(ABC)

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

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

Submission status: Accepted

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

k = int(input())

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

n.sort()

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


print(sum(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
k = int(input())
d = max(a,b,c)
for i in range(0,k):
    d *= 2

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

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
k = int(input())
list_abc = list((a,b,c))
list_abc.sort()
while k > 0:
    list_abc[-1] *= 2
    k -= 1
ans = 0
for number in list_abc:
    ans += number
print(ans)

Submission status: Accepted

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

for i in range(k):
    a = max(n)
    n.remove(a)
    n.append(a*2)
print(sum(n))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

values = sorted([a, b, c])
maxv = values[-1]
maxv = maxv * (2 ** k)
print(sum(values[:2], maxv))

Submission status: Accepted

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

li[-1] = li[-1] * 2 ** k

print(sum(li))

Submission status: Accepted

Solution code:
value = []
for part in input().split():
    value.append(int(part))

value.sort()
value.reverse()

k = int(input())
value[0] = value[0] * (2 ** k)

print(sum(value))

Submission status: Accepted

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

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())
m = a+b+c+max(a,b,c)*(2**k - 1)
print(m)

Submission status: Accepted

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

Submission status: Accepted

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

for _ in range(k):
    three_int = sorted(three_int, reverse=True)
    # 0th element is the max value in the list (A, B, C)
    three_int[0] = three_int[0] * 2
print(sum(three_int))

Submission status: Accepted

Solution code:
a, b, c = map(int, raw_input().split())
k = int(raw_input())
max_value = max([a,b,c])
value = max_value
for i in range(k):
    value = value * 2
print(sum([a,b,c]) - max_value + value)

Submission status: Accepted

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

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

print(A + B + C)

Submission status: Accepted

Solution code:
a = input().split()
a = [int(s) for s in a]
k = int(input())
maxi = int(max(a))
ans = 0 - maxi
for i in range(k):
    maxi = maxi * 2
for i in a:
    ans = ans + int(i)
print(str(maxi+ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(val + sum([A, B, C]) - max([A, B, C]))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inpt = map(int, raw_input().split())
inpt.sort()
K = int(raw_input())

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

print inpt[0] + inpt[1] + inpt[2]

Submission status: Accepted

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

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

ans = M*(2**K) + sum(L)
print(ans)

Submission status: Accepted

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

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())
K=int(input())
print(max(A,B,C)*2**K+A+B+C-max(A,B,C))

Submission status: Accepted

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

Submission status: Accepted

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

l = list(map(int, input().split()))  # A = l[0], B = l[1], C = l[2]
k = int(input())

l.sort()

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

print(sum(l))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input())
for i in range(k):
  if a >= b and a >= c:
    a *= 2
  elif b >= a and b >= c:
    b *= 2
  else:
    c *= 2
print(sum([a, b, c]))

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

print(max(arr) * (2 ** k - 1) + sum(arr))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

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

    m = max(A, B, C)
    d = m
    for i in range(K):
        d *= 2
    print(A + B + C - m + d)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

max_int = max(A,B,C)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# --------------------------------------------

dp = None

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

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

    print(sum(A))

main()

Submission status: Accepted

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

Submission status: Accepted

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

max_abc = max(A,B,C)
rem = A+B+C - max_abc
for i in range(K):
    max_abc *= 2

print(rem+max_abc)

Submission status: Accepted

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

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 = [int(x) for x in input().split()]
K = int(input())

def main():
    list = [A, B, C]
    list.sort(reverse=True)
    list[0] *= 2 ** K
    print(sum(list))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

List = [A, B, C]
sort_list = sorted(List)

sort_list[2] = sort_list[2] * (2**K)

SUM = sum(sort_list)


print(SUM)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding :utf-8
n=[int(i) for i in input().split()]
a=int(input())
n.sort()
n[0]=n[0]+n[1]+n[2]*2**a
print(n[0])

Submission status: Accepted

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

K = int(input())
i =1
while i<=K:
    i +=1
    a = suuti.index(max(suuti))
    suuti[a]= 2*max(suuti)

print(sum(suuti))

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
k=int(input())
for i in range(3):
    if a[i]==max(a):
        a[i]*=2**k;break
print(sum(a))

Submission status: Accepted

Solution code:
a=input().split()
b=int(input())
c=[int(i) for i in a]
d=0
for j in c:
  d+=j
d=d-max(c)
d=d+(max(c))*(2**b)
print(d)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int,input().split())
k = int(input())
sumn = a+b+c
maxn = max(a,b,c)
sumn -= maxn

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

print(sumn+maxn)

Submission status: Accepted

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

def main():
    blackboard_list = list(map(int, input().split()))
    K = int(input())

    blackboard_list[blackboard_list.index(max(blackboard_list))] = max(blackboard_list) * 2 ** K
    print(sum(blackboard_list))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

c = k
while c > 0:
    l.sort(reverse=True)
    l[0] = l[0]*2
    c = c-1

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

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:
# your code goes here
li = list(map(int,input().split()))	
k=int(input())

for j in range(0,k):
	li[li.index(max(li))] = li[li.index(max(li))]*2

print(sum(li))

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(k):
    largest = max(a,b,c)
    if largest == a:
        a = 2*a
    elif largest == b:
        b = 2*b
    elif largest == c:
        c = 2*c
print(a+b+c)

Submission status: Accepted

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

A = int(A)
B = int(B)
C = int(C)

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

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:
x=input().split()
y=0
while y<len(x):
    x[y]=int(x[y])
    y+=1
x.sort()
k=int(input())

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

Submission status: Accepted

Solution code:
"""
https://abc096.contest.atcoder.jp/tasks/abc096_b
"""
[a,b,c]=[int(i) for i in input().split()]
k=int(input())
d=max(a,b,c)*(2**k)
if max(a,b,c)==a:
    print(b+c+d)
elif max(a,b,c)==b:
    print(a+c+d)
else:
    print(a+b+d)

Submission status: Accepted

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

Submission status: Accepted

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

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

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 = map(int, input().split())
X = {'A':a, 'B':b, 'C':c}
K = int(input())
for i in range(K):
    max_k = max(X, key=X.get)
    X[max_k] *= 2
print(sum(X.values()))

Submission status: Accepted

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

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

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(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())
for k in range(K):
    m = max(A,B,C)
    if A == m:
        A *= 2
    elif B == m:
        B *= 2
    else:
        C *= 2
print(A+B+C)

Submission status: Accepted

Solution code:
a = input().split()
a2 = []
for _ in a:
    a2.append(int(_))
k = int(input())
for i in range(k):
    target = a2.index(max(a2))
    a2[target] *= 2
print(sum(a2))

Submission status: Accepted

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

    maxNumIndex = nums.index(max(nums))
    nums[maxNumIndex] *= 2**N

    print(sum(nums))

Submission status: Accepted

Solution code:

def main():
    ns = [int(i) for i in input().split()]
    k = int(input().strip())

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

    print(sum(ns))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np

a = list(map(int, input().split()))
k = int(input())
for i in range(0, k):
    max_sub = np.argmax(a)
    a[max_sub] = a[max_sub] * 2
print(sum(a))

Submission status: Accepted

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

l = sorted([a, b, c])
print(l[-1] * (2 ** k) + l[0] + l[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ns = [int(s) for s in input().split()]
k = int(input())

nn = pow(2, k)
ans = sum(ns) - max(ns) + max(ns) * nn
print(ans)

Submission status: Accepted

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

max = max(a,b,c)
ans = a+b+c + max*(2**K) - max


print(ans)

Submission status: Accepted

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

list = [a,b,c]

max = max(a,b,c)

sum = a+b+c
sum += max * (2**K - 1)

print (sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = [int(i) for i in input().split()]
K = int(input())
for k in range(K):
    m = max(N)
    i = N.index(m) # get index of max
    N[i] = 2*m
print(sum(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c = input().split()
A = int(a)
B = int(b)
C = int(c)
K = int(input())

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

sum_abc = A + B + C
print(sum_abc)