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

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

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()))
k = int(input())
print(sum(l) + (2**k-1)*max(l))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

a = sorted(a, reverse=True)

print(a[0]*(1<<k)+a[1]+a[2])

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
k = int(input())
ind = a.index(max(a))
b = max(a)
a[ind] = a[ind]*2**k
print(sum(a))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ABC = list(map(int,input().split()))
K = int(input())
#import numpy as np
#ABC[ABC.index(max(ABC))] = ABC[ABC.index(max(ABC))]*2*K
#print(sum(ABC))
ans = []
ABC.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
*l,k=map(int,open(0).read().split());print(sum(l)+max(l)*~-2**k)

Submission status: Accepted

Solution code:
# ABC 96, B - maximum sum
X = [int(el) for el in input().split(' ')]
k = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = A * 2 ** K + B + C
b = A + B * 2 ** K + C
c = A + B + C * 2 ** K
print(max(a,b,c))

Submission status: Accepted

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

s = li.index(max(li))

for i in range(k):
    li[s] *= 2
    
print(sum(li))

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

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

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
k = int(input())
num = [a,b,c]
while k > 0:
    num[num.index(max(num))] = max(num)*2
    k -= 1
print(sum(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:
import math

#x = int(input())
#a = int(input())
#ls = list(input().split(" "))
ls = list(map(int,input().split(" ")))
#a,b = list(map(int,input().split(" ")))
#a,b,c = list(input().split())
#string = input()

k = int(input())

maxnum = max(ls)
ls.remove(maxnum)
for i in range(k):
  maxnum = maxnum * 2
print(sum(ls) + maxnum)

Submission status: Accepted

Solution code:

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


def pow(x,k):
    return x * pow(x, k - 1) if k > 0 else 1

print(a+b+c*pow(2,k))

Submission status: Accepted

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

s = sum([a, b, c])

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

print(m * 2 ** K + s - m)

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

editlist = [A, B, C]
editlist.sort(reverse=True)

for i in range(K):
    editlist[0] = editlist[0] * 2
ans = 0
for i in editlist:
    ans += i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    a, b = LI()
    if a <= b:
        print(a)
    else:
        print(a-1)
    return

#B
def B():
    a, b, c = LI()
    k = II()
    print(a + b + c + max(a, b, c) * ((2 ** k) - 1))
    return

#C
def C():
    return

#D
def D():
    n = II()
    ans = []
    sosu = [2]
    i = 2
    while len(ans) != n:
        for k in sosu:
            if i % k == 0:
                i += 1
                break
        else:
            sosu.append(i)
            if i % 5 == 1:
                ans.append(i)
            i += 1
    for i in ans:
        print(i, end=" ")
    print()
    return


#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

s = list(map(int, input().split()))
K = int(input())
max_index = s.index(max(s))

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

print(sum(s))

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

Submission status: Accepted

Solution code:
ABC = [int(i) for i in 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(" "))
k = int(input())
m = max(a, b, c)
s = a + b + c - m + (m * (2 ** k))
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
mx = max(A, B, C)
moto = A+B+C-mx
print(moto+mx*(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:
ABC = list(map(int, input().split()))
ABC.sort()
K = int(input())
print(ABC[0]+ABC[1]+ABC[2]*(2**K))

Submission status: Accepted

Solution code:
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()))
b = int(input())
print(sum(a)+max(a)*(2**b)-max(a))

Submission status: Accepted

Solution code:
# coding: utf-8
import time
import re
import math
import fractions

def main():
    A=list(map(int,input().split()))
    K=int(input())
    A.sort(key=lambda x:-x)
    print(sum(A)-A[0]+A[0]*(2**K))
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#A=list(map(int,input().split()))
#A,B,C=map(int,input().split())
#n=int(input())

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

max_num = max(abc)
abc.remove(max_num)

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

print(max_num + sum(abc))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    l = list(map(int, input().split()))
    k = int(input())

    max = max(l)

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

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

ans=sorted(nums,reverse=True)

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

print(sum(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

answer = A + B + C - max(A, B, C)
answer += max(A, B, C) * 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])
sum = A + B + C - max_num

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

print(sum)

Submission status: Accepted

Solution code:
lst = sorted(list(map(int,input().split())),reverse=True)
n = int(input())
ans=lst[0]*2**n+sum(lst[1:])
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:
abc = list(map(int, input().split()))
k = int(input())

x = max(abc)
total = sum(abc) - x + (x * (2 ** k))

print(total)

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

A, B, C = nl()
K = n()

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

print(sum(nums))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
vals = sorted(list(map(int, input().split())))
k = int(input())
m = vals.pop()

print(sum(vals) + m * (2 ** k))

Submission status: Accepted

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

L.sort(reverse=True)
m=L[0]*(2**k)
ans=sum(L[1:])+m

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = [int(num) for num 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:
def abc():
    l = sorted(map(int, input().split()))
    n = int(input())
    l[-1] = l[-1] * (2 ** n)
    print(sum(l))


abc()

Submission status: Accepted

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

for i in range(k):
    m = max(lst)
    ind = lst.index(m)
    mm = m * 2
    lst[ind] = mm

print(sum(lst))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

    answer = -1
    for i in range(k):
        if a == max(a,b,c):
            a = 2*a
        elif b == max(a,b,c):
            b = 2*b
        elif c == max(a,b,c):
            c = 2*c

    answer = a + b + c
    print(answer)

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")

# X = int(sys.stdin.readline())
#
# beki = {1}
# for i in range(2, 1001):
#     e = 2
#     while i ** e <= X:
#         beki.add(i ** e)
#         e += 1
# print(max(beki))
#


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

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

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:
ABC = [int(abc) for abc in 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=sorted(list(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())
print(max(A, B, C) * (2 ** K - 1) + A + B + C)

Submission status: Accepted

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

answer = a+b+c + (2**n-1)*x
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = sorted([ int(v) for v in 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())

l = [a,b,c]
l = sorted(l, reverse=True)
for i in range(k):
    l[0] = l[0] * 2

print(sum(l))

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
a, b, c = map(int, input().split())
k = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

K = int(input())

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

sum = 0    
for j in N : 
    sum += j
    
print(sum)

Submission status: Accepted

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

max_n = max(a, b, c)
if max_n == c:
    rem = [a, b]
elif max_n == b:
    rem = [a, c]
else:
    rem = [b, c]
for _ in range(k):
    max_n *= 2
print(sum(rem) + max_n)

Submission status: Accepted

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

Submission status: Accepted

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

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:
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=input().split()
k=int(input())
a=int(A)
b=int(B)
c=int(C)
if a>=b:
  if a>=c:
    a=a*(2**k)
    print(a+b+c)
  else:
    c=c*(2**k)
    print(a+b+c)
else:
  if b>=c:
    b=b*(2**k)
    print(a+b+c)
  else:
    c=c*(2**k)
    print(a+b+c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=list(map(int,input().split()))
A.sort()
z=int(input())
k=max(A)
for i in range(1,z+1):
    k=k*2
A.pop(len(A)-1)
A.append(k)
print(sum(A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

index = l.index(max(l))
l[index] = l[index] * 2**k
print(sum(l))

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

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-i+1):
        ans=max(ans,A*pow(2,i)+B*pow(2,j)+C*pow(2,K-i-j))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

m = max(abc)

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

print(sum(abc)+m-max(abc))

Submission status: Accepted

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


def solve(A: int, B: int, C: int, K: int):
    L = [A,B,C]
    L.sort()

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


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, C, K)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inpt = map(int, raw_input().split())
K = int(raw_input())
inpt.sort()
for i in range(0, K):
	inpt[2] *= 2
print inpt[0]+inpt[1]+inpt[2]

Submission status: Accepted

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

Submission status: Accepted

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

arr.sort()

print(sum(arr[:2]) + arr[2] * 2 ** k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 最大値を求めるためソートする
l.sort()

# 一番大きい数をK回2倍する
for i in range(K):
  l[-1]*=2

# 和を出力
print(sum(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
number = list(map(int,input().split()))
K = int(input())
sum = 0
times = 0

while True:
    large_number = max(number)
    number.remove(large_number)
    number.append(large_number*2)
    times += 1
    if times == K:
        break
for i in range(3):
    sum += number[i]
print(sum)

Submission status: Accepted

Solution code:
abc = list(map(int, input().split()))
n = int(input())
maxAbc = max(abc)
abc.pop(abc.index(max(abc)))

for i in range(n):
    maxAbc *= 2
    
print(sum(abc) + maxAbc)

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 = map(int,input().split())
K = int(input())
L = max(A,B,C)
if L == A:
  print((A*(2**K))+B+C)
elif L == B:
  print(A+(B*(2**K))+C)
else:
  print(A+B+(C*(2**K)))

Submission status: Accepted

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


def solve(A: int, B: int, C: int, K: int):
    mx = max(A, B, C)
    ret = mx * (2 ** K) + A + B + C - mx
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, C, K)

if __name__ == '__main__':
    main()