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: Wrong Answer

Solution code:
d = list(map(int, input().split(' ')))
k = int(input())
for iter_count in range(k):
    m = max(d)
    d = [i for i in d if i != m ] + [2*m]
    
print(sum(d))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import itertools
from heapq import heapify, heappop, heappush
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))



##### main #####
def main():
	l = LI()
	K = I()
	max_l = max(l)

	add_max = max_l * (2 * K)
	print(sum(l) - max_l + add_max)


if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
a, b ,c = map(int, raw_input().split())
k=int(raw_input())*2
if(a<b):
	if (b<c):
		x=a+b+c*k
	else:
		x=a+c+b*k
else:
	if(a<c):
		x=a+b+c*k
	else:
		x=b+c+a*k
print(x)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())  # 入力
k = int(input())  # 入力
num_ary = [a, b, c]
max_n = max(num_ary)

max_index = num_ary.index(max_n)#最大値のindex

max_num = max_n * pow(2, 2)

num_ary[max_index] = max_num

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

Submission status: Wrong Answer

Solution code:
# Max sum
A, B, C = list(map(int,input().strip().split(' ')))
K = int(input().strip())
v = [A,B,C]
o = 0
for i in range(K):
    for j in range(K-i):
        k = K-j-i
        tmp = [v[0]*max(2*i,1),v[1]*max(2*j,1),v[2]*max(2*k,1)]
        if o < sum(tmp):
            o = sum(tmp)
print(o)

Submission status: Wrong Answer

Solution code:
# Max sum
A, B, C = list(map(int,input().strip().split(' ')))
K = int(input().strip())
v = [A,B,C]
o = 0
for i in range(K):
    for j in range(K-i):
        k = K-j-i
        tmp = [v[0]*max(2*i,1),v[1]*max(2*j,1),v[2]*max(2*k,1)]
        if o < sum(tmp):
            o = sum(tmp)
            print(tmp)
print(o)

Submission status: Wrong Answer

Solution code:

if __name__ == "__main__":
    A, B, C = list(map(int, input().split()))
    K = int(input())
    l = [A, B, C]
    l.sort()
    ans = l[2] * 2 * K + l[0] + l[1]
    print(ans)

Submission status: Wrong Answer

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

L.sort()
print(L)

print(sum(L) + L[len(L) - 1] * (2 ** K - 1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

M = max(A, B, C)

SUM = M*(2**K)

if M == A:
	SUM+=(B+C)
	print(SUM)
	exit(0)

	if M == B:
		SUM+=(A+C)
		print(SUM)
		exit(0)

		if M == C:
			SUM+=(A+B)
			print(SUM)

Submission status: Wrong Answer

Solution code:
import math
import itertools
from heapq import heapify, heappop, heappush
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))



##### main #####
def main():
	l = LI()
	K = I()
	max_l = max(l)

	add_max = [max_l * 2 * (i+1) for i in range(K)][-1]

	print(sum(l) - max_l + add_max)


if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
def main(a, b, c, k):
  abc = [a, b, c]
  abc.sort
  abc[-1] *= 2**k
  print(sum(abc))

# tests = [
#   [5, 3, 11, 1],  # 30
#   [3, 3, 4, 2],  # 22
# ]

# for test in tests:
#   main(*test)

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

Submission status: Wrong Answer

Solution code:
num = input()
num = num.rstrip().split(" ")
if int(num[0])>=10:
    num[0]=num[0]
else:
    num[0]="0"+str(num[0])
if int(num[1])>=10:
    num[1]=num[1]
else:
    num[1]="0"+str(num[1])
if int(num[2])>=10:
    num[2]=num[2]
else:
    num[2]="0"+str(num[2])


list1 = [int(num[0]),int(num[1]),int(num[2])]
list1 = sorted(list1)
#print(list1)
count= input()

print(int(list1[2]*int(count)*2+list1[1]+list1[0]))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000)

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

ans = []

for i in range(0, k, 1):
    for j in range(0, k-i, 1):
        ans.append(a*(2**i) + b*(2**j) + c*(2**(k-i-j)))
ans.append(a*(2**k) + b + c)

print(max(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

maximun = max(ABC)
index = 0
for i in range(3):
    if ABC[i] - maximun == 0:
        index = i

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

print(sum(ABC))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000)

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

ans = []

for i in range(0, k, 1):
    for j in range(0, k-i, 1):
        ans.append(a*(2**i) + b*(2**j) + c*(2**(k-i-j)))
ans.append(a*(2**k))

print(max(ans))

Submission status: Wrong Answer

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

M = max(A, B, C)

SUM = M*(2**K)

if M == A:
	SUM+=(B+C)

if M == B:
	SUM+=(A+C)

if M == C:
	SUM+=(A+B)

print(SUM)

Submission status: Wrong Answer

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

L.sort()

print(sum(L) + L[len(L) - 1] * K)

Submission status: Wrong Answer

Solution code:
# n = int(raw_input())
# a = [int(raw_input()) for i in xrange(n)]
a, b, c = map(int, raw_input().split())
k = int(raw_input())
# print "".join(["a","b"])

# print "Yes" if 3 > 0 else "No"


l = sorted([a,b,c])
m=l[2]

for i in xrange(k):
    m *= 2
    print m

print m + l[0] + l[1]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A.sort
ans =A[0]+A[1]+A[2]*(2**K)

print(ans)

Submission status: Wrong Answer

Solution code:
x= list(map(int,input().split()))
k = int(input())
max = 0


for f in range(3):
    temp = 0
    for i in range(k):
        temp = temp + x[f] * 2
    if temp > max:
        max = temp

print(max)

Submission status: Wrong Answer

Solution code:

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

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

print(A+B+C)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = input()
num = num.rstrip().split(" ")

list1 = [int(num[0]),int(num[1]),int(num[2])]
list1 = sorted(list1)
#print(list1)
count= input()

print(int(list1[2]*int(count)*2+list1[1]+list1[0]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

l1 = sys.stdin.readline()
l2 = sys.stdin.readline()

nums = [int(x) for x in l1.rstrip('\n').split(' ')]
l2 = int(l2)

out = max(nums)

for i in xrange(l2):
  out *= 2
print out

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000)

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

ans = []

for i in range(0, k, 1):
    for j in range(0, k-i, 1):
        ans.append(a*(2**i) + b*(2**j) + c*(2**(k-i-j)))

print(max(ans))

Submission status: Wrong Answer

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

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

print(A+B+C)

Submission status: Wrong Answer

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

x = max(a,b,c)

y = x * (2**k)

if x==a: print(y+b+c)
if x==b: print(a+y+c)
if x==c: print(a+b+y)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a = Is()
k = I()
print(sum(a)-max(a) + max(a)*(2*k))

Submission status: Wrong Answer

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

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

max_sum = max(a)
for i in range(0,K):
    max_sum = max_sum*2

for i in a:
    if i == max(a):
        pass
    else:
        max_sum = max_sum + i

print(max_sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A.sort

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

Submission status: Wrong Answer

Solution code:
a,b,c = map(int, input().split())
k = int(input())
for n in range(k):
    if max(a,b,c)==a:
        a*=k
    if max(a,b,c)==b:
        b*=k
    if max(a,b,c)==c:
        c*=k
print(a+b+c)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, raw_input().split())
K = int(raw_input())
print sum([A, B, C]) + K*max(A, B, C)

Submission status: Wrong Answer

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

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

M2 = M * pow(2,k)

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

input_num = input().split(" ")
a = int(input_num[0])
b = int(input_num[1])
c = int(input_num[2])
k = int(input())

output = 0
maxnum = max([a,b,c])
for i in [a,b,c]:
    if i != maxnum:
        output += i

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

output += maxnum

print(output)

Submission status: Wrong Answer

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

max_num = max(number)
number.remove(max_num)

max_num = max_num * 2 * k

print(number[0]+number[1]+max_num)

Submission status: Wrong Answer

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

    return A + B + C + max(A,B,C) **K - max(A,B,C)

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
a=map(int, raw_input().split())
K=input()
max_a=max(a)
x=max_a*(2**K)

ans=x
for i in a:
	if i!=max_a:
		ans+=i
print ans

Submission status: Wrong Answer

Solution code:
# n = int(raw_input())
# a = [int(raw_input()) for i in xrange(n)]
a, b, c = map(int, raw_input().split())
k = int(raw_input())
# print "".join(["a","b"])

# print "Yes" if 3 > 0 else "No"


l = sorted([a,b,c])

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

Submission status: Wrong Answer

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

for i in range(k):
    s += max(a,b,c)

print(s)

Submission status: Wrong Answer

Solution code:
import math

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

K = int(input())

max_num = max(A, B, C)

result = A + B + C * math.pow(2, K)

print(int(result))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split(" "))
n = int(input())
result = 0

result = max(a,b,c) * n * 2 + a + b + c - max(a,b,c)

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
k = int(input())
s = a+b+c
aa = s
bb = s
cc = s
for i in range(k):
    aa += a
    bb += b
    cc += c


print(max(aa,bb,cc))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
k = int(input())
s = a+b+c
aa = 0
bb = 0
cc = 0
for i in range(k):
    aa += a
    bb += b
    cc += c


print(max(aa,bb,cc))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

aa = a*2 + b + c
bb = a + b*2 + c
cc = a + b + c*2

print(max(aa,bb,cc))

Submission status: Time Limit Exceeded

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

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

print(sum(nums))

Submission status: Time Limit Exceeded

Solution code:
L = list(map(int, input().split()))
K = int(input())
# L.sort()
# L.reverse()
# L = L[::-1]

counter = 0
while counter<K:
  if L[-1] <= 50:
    L[-1] = L[-1]*2
    L.sort()
    # L.reverse()
    counter+=1

print(sum(L))

Submission status: Time Limit Exceeded

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

counter = 0
while counter<K:
  if L[0] <= 50:
    L[0] = L[0]*2
    L.sort()
    L.reverse()
    counter+=1

print(sum(L))

Submission status: Time Limit Exceeded

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

counter = 0
while counter<K:
  if L[0] <= 50:
    L[0] *=2
    L.sort()
    L.reverse()
    counter+=1

print(sum(L))

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b, c = sorted(Input())
    k = int(input())

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

m = max(a,b,c)
re = sum([a,b,c]) - m
print(re + m*2**(k))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def answer(a: int, b: int, c: int, k: int) -> int:
    nums = sorted((a, b, c))
    nums[-1] = nums[-1] * 2 ** k

    return sum(nums)


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(A))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
m, *A = sorted([int(x) for x in input().split()], reverse=True)
K = int(input())
  
print((m * 2**K) + sum(A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

d=max(l)
e=d*(2**k)

l.remove(max(l))
l.append(e)

print(sum(l))

Submission status: Accepted

Solution code:
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:
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
num_list = [int(num) for num in lines.pop(0).split(" ")]
k, = [int(num) for num in lines.pop(0).split(" ")]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

M=sorted([A,B,C])
m=M[-1]

m=m*2**K

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num1, num2, num3 = map(int, input().split())
count = int(input())

max_num = max(num1, max(num2, num3))

sum_num = num1 + num2 + num3 - max_num
end_num = max_num
for i in range(count):
    end_num *= 2

print(sum_num + end_num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(k):
    max_id = n.index(max(n))
    n[max_id] *= 2
print(sum(n))

Submission status: Accepted

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

_sum = []
_max = max(A, B, C)
remaining = [r for r in [A, B, C] if r != _max]
if len(remaining) == 0:
    remaining = [_max, _max]
if len(remaining) == 1:
    remaining.append(_max)

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

print(_max + sum(remaining))

Submission status: Accepted

Solution code:
#a=int(input())
#b,c=int(input()),int(input())
# c=[]
#  for i in b:
#     c.append(i)
#e1,e2 = map(int,input().split())
f = list(map(int,input().split()))
K=int(input())
#j = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))
f.sort(reverse=True)
for i in range(K):
    f[0]*=2
print(sum(f))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math
# b=input()
# c=[]
# for i in range(b):
#     c.append(a[i])
a = list(map(int,input().split()))
#b = list(map(int,input().split()))
s=int(input())

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

Submission status: Accepted

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

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

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

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

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

maximum = display[-1]
for i in range(K):
    maximum = maximum*2
# print(maximum)
# print(display[:-1])
# print(sum(display[:-1]))
print(sum(display[:-1])+maximum)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a,b,c= sorted([a,b,c])
print(a+b+c*2**n)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = sorted(list(map(int, input().split())))
m = a.pop()
for i in range(int(input())):
  m *= 2
print(sum(a) + m)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    x = list(map(int, readline().split()))
    K = int(readline())
    x.sort(reverse=True)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
l=[int(x) for x in input().split()]
k=int(input())
m=max(l)
l.remove(max(l))
for i in range(k):
    m *= 2 
print(sum(l)+m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ABC = sorted(ABC)

ret = ABC[2]
for i in range(K):
    ret = ret * 2

ret += sum(ABC[:2])

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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