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

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

Submission status: Accepted

Solution code:
# B
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:
num=list(map(int,input().split()))
k=int(input())
ans1=sum(num)-max(num)
print(2**k*max(num)+ans1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
li=sorted(list(map(int,input().split())))
a=li.pop(-1)
k=int(input())
a=a*(2**k)
for i in li:
  a+=i
print(a)

Submission status: Accepted

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

    abc = [a, b, c]
    max_index = abc.index(max(a, b, c))
    ans = 0
    for i in range(3):
        num = abc[i]
        if i == max_index:
            for _ in range(k):
                num *= 2
            ans += num
        else:
            ans += num

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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*2**k)-m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem B - Maximum Sum

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

# initialization
max_cost = 0

# max index search
if a>=b and a>=c:
    for i in range(k):
        a = a * 2
elif b>=a and b>=c:
    for i in range(k):
        b = b * 2
elif c>=a and c>=b:
    for i in range(k):
        c = c * 2

ans = a + b + c
print(ans)

Submission status: Accepted

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

m = max(N)
print(m * (2 ** K) + sum(N) - m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
K=int(input())
a=[A,B,C]
b=max(a)
a.remove(b)
print(b*2**K+sum(a))

Submission status: Accepted

Solution code:
import math
import string


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

abc = readints()
k = int(input())
x = sorted(abc)
xx = x[2]
for _ in range(k):
    xx *= 2
print(x[0]+x[1]+xx)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    A=sorted(list(map(int,input().split())), reverse=True)
    k=int(input())

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



    print(sum(A))




resolve()

Submission status: Accepted

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

print(sum(x))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

A,B,C = list(map(int, input().rstrip().split()))
K = int(input().strip())
#-----

num_list = sorted( [A,B,C] )
ans = sum(num_list) - num_list[-1] + num_list[-1] * (2**K)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print((max_num) * pow(2, K) + sum([A, B, C]) - max_num)

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

maxnum = max(ABC)
ABC.remove(maxnum)
ans = maxnum * (2**K)
print(sum(ABC) + ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

num.sort(reverse=True)

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

print(sum(num))

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

Submission status: Accepted

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

l.sort()
for _ in range(k):
    l[2] *= 2

print(sum(l))

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(N))

Submission status: Accepted

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

t.sort()

n=int(input())

for i in range(n):
    t[-1] *= 2
print(sum(t))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC096

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(sum(a))

Submission status: Accepted

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

s = sum(i)
s = s + max(i)*(2**(n)-1)

print(s)

Submission status: Accepted

Solution code:
li = [ int(x) for x in input().split() ]
K = int(input())

li.sort()

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

Submission status: Accepted

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

x=max(a,b,c)

for i in range(1,k+1):
  x = x*2
  
  
kk =  (a+b+c)-(max(a,b,c)) + int(x)

print(kk)

Submission status: Accepted

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

abc_MAX=max(A,B,C)

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

Submission status: Accepted

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

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 - 1)
print(ans)

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]) + max([A, B, C]) * (2 ** K))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a_L = sorted(a_L,reverse=True)
a_L[0] = a_L[0] * 2**k

#print(a_L)
print(sum(a_L))

Submission status: Accepted

Solution code:
ABC=list(map(int,input().split()))
K=int(input())
for k in range(K):
    maximum=max(ABC)
    ABC.remove(maximum)
    ABC.append(maximum*2)
print(sum(ABC))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# スマホ
l=list(map(int,input().split()))
k=int(input())
s=max(l)
ans=sum(l)-s
ans+=s*pow(2,k)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k=int(input())

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

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

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(abc))

Submission status: Accepted

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

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

for i in range(k):
    maxi *= 2
print(ans + maxi)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

n_list = list(map(int, input().split()))
K = int(input().split()[0])

n_list = list(sorted(n_list, reverse=True))
n = n_list[0]
for _ in range(K):
    n = n * 2
ans = n + n_list[1] + n_list[2]
print(ans)

Submission status: Accepted

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

print(sum(n)+max(n)*sum(2**i for i in range(k)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


ABC = list(map(int, sys.stdin.buffer.readline().split()))
K = int(sys.stdin.buffer.readline())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
k = int(input())
l = sorted(l, reverse=1)
a=l.pop(0)
l.append(a*2**k)
print(sum(l))

Submission status: Accepted

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

while k > 0:
    abc.sort()
    abc[2] = abc[2] * 2
    k -= 1

print(sum(abc))

Submission status: Accepted

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

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

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

print(S)

Submission status: Accepted

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

Submission status: Accepted

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

max_num = nums.pop(nums.index(max(nums)))

max_sum = sum(nums) + (max_num * (2 **k))

print(max_sum)

Submission status: Accepted

Solution code:
a, b, c = input().split(" ")
k = int(input())
lis = [int(a), int(b), int(c)]
lis.sort(reverse = True)

for _ in range(1, k+1):
  m = max(lis) * 2
  lis[0] = m

print(sum(lis))

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)*pow(2,k))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    numbers = list(map(int, input().split(" ")))
    double_time = int(input())
    numbers.sort()
    for i in range(double_time):
        numbers[-1] *= 2
    print(sum(numbers))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b, c = sorted(map(int, input().split()), reverse=True)
print(sum([a << int(input()), b, c]))

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
K = int(input())
l.sort()
a = l.pop()
print((2 ** K) * a + sum(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
L=list(map(int,input().split()))
k=int(input())
M=L.pop(L.index(max(L)))
for _ in range(k):
    M=M*2
print(sum(L)+M)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(3):
    if max(ll) == ll[i]:
        ll[i] = ll[i]*(2**k)
print(sum(ll))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b,c=INTM()
    k=INT()
    d=max(a,b,c)
    e=d*(2**k)
    ans=a+b+c+e-d
    print(ans)
    
if __name__ == '__main__':
    do()

Submission status: Accepted

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

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

d = max(A, B, C)
e = d * 2**K

print(e+A+B+C-d)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = max(a, b, c)
for _ in range(k):
  ans = ans * 2
print(ans + a + b + c - max(a, b, c))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

res = max_value *(2**k) + a + b + c - max_value

print(res)

Submission status: Accepted

Solution code:
# AL006 B

nums = list(map(int, input().split()))
k = int(input())
maxNum = max(nums)

for i in range(k):
    nums[nums.index(maxNum)] = maxNum * 2
    maxNum = maxNum * 2

print(sum(nums))

Submission status: Accepted

Solution code:
l=sorted([int(x) for x in input().split()],reverse=True)
k=int(input())

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

Submission status: Accepted

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

n = sum(sorted(a)[:-1])
s = sorted(a)[-1]

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

print(n + s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m = max(a)
a.remove(m)
print(m*2**k + sum(a))

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+d*2**k)

Submission status: Accepted

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

a1 = sorted(a)

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

Submission status: Accepted

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

for i in range(k):
  maxindex = max(enumerate(nums), key = lambda x:x[1])[0]
  nums[maxindex] *= 2
  i = i + 1

print(sum(nums))

Submission status: Accepted

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

while i in range(k):
  maxindex = max(enumerate(nums), key = lambda x:x[1])[0]
  nums[maxindex] *= 2
  i = i + 1

print(sum(nums))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

l = many_int()
K=one_int()

M=max(l)

l.remove(M)

print(M*(2**K)+sum(l))

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
K = int(input())
ans = 0
l = [A,B,C]
k = max(l)
l.remove(k)
ans = sum(l) + (2**K)*k
print(ans)

Submission status: Accepted

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

aa = sorted(a)
ans = aa[0]+aa[1]+aa[2]*(2**k)
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(a[0]+a[1]+a[2])

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())
l=[A,B,C]
l.sort(reverse=True)

print(int(l[0]*pow(2,K)+l[1]+l[2]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input().strip())
m = max(a, b, c)
tmp = m
for i in range(k):
    m *= 2
print(sum((m, a, b, c)) - tmp)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
k = int(input().strip())
m = max(a, b, c)
tmp = m
for i in range(k):
    m *= 2
print(sum((m, a, b, c)) - tmp)

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,b,c=map(int,input().split())
d=int(input())
e=max(a,b,c)
f=a+b+c+e*2**(d)-e
print(f)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
a,b,c = map(int,input().split())
k = int(input())
print((2**k-1)*max([a,b,c])+sum([a,b,c]))

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A = [int(x) for x in readline().split()]
K = int(readline())
A.sort()

A[-1] = A[-1] * 2 ** K
print(sum(A))

Submission status: Accepted

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

Submission status: Accepted

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

for _ in range(K):
    ABC[ABC.index(max(ABC))] *= 2
print(sum(ABC))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, raw_input().split())
k = 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())
largest = max(A, B, C)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nList = sorted(list(map(int,input().split())),reverse=True)
k = int(input())

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

Submission status: Accepted

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

ans = 0
for i in range(k+1):
    for j in range(k+1):
        if i+j <= k:
            ans = max(ans, a*2**i+b*2**j+c*2**(k-i-j))

print(ans)

Submission status: Accepted

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

print(sum(ABC[:2]) + (ABC[-1]) * (2 ** K))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
items=list(map(int, input().split()))
K=int(input())
max_index = items.index(max(items))
for i in range(K):
    items[max_index] = items[max_index] * 2

print(sum(items))

Submission status: Accepted

Solution code:
A = [int(a) for a in input().split()]
A.sort()
K = int(input())
print(A[0] + A[1] + A[2] * 2 ** K)

Submission status: Accepted

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

ABC_1 = sorted(ABC)

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

print(sum(ABC_1))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
a,b,c=map(int,input().split())
K=int(input())
l=[a,b,c]
m=max(l)
ans=0
ans+=m*2**K
i=l.index(m)
del l[i]
ans+=sum(l)
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

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

L=[A,B,C]
L.sort()

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

print(ans)

Submission status: Accepted

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

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

print(ans)

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

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

Submission status: Accepted

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

x = [a, b, c]
for i in range(k):
   x[x.index(max(x))] = max(x) * 2
print(sum(x))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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:
import sys
input = sys.stdin.readline
li = [int(i) for i in input().split()]
K = int(input())
li.sort()
ans = 0
li[-1] *= 2 **K
for i in range(3) :
    ans += li[i]
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) + sum([A,B,C]))