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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = [int(_) for _ in input().split()]
K = int(input())
print(max(A, B, C) * ((2 ** K) - 1) + A + B + C)

Submission status: Accepted

Solution code:
def solve(string):
    *abc, k = map(int, string.split())
    abc = sorted(abc)
    for i in range(k):
        abc[-1] *= 2
    return str(sum(abc))


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(k):

    i_ = nums.index(max(nums))
    nums[i_] = nums[i_] * 2

print(sum(nums))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

maximum = max(L)
print(sum(L) - maximum + maximum * 2 ** K)

Submission status: Accepted

Solution code:
# /user/bin/python
# -*- coding: utf-8 -*-
import sys


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

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
a, b, c = (int(i) for i in 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(max(A,B,C)*2**K+sum((A,B,C))-max(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)+(max(a,b,c)*2**k))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def maximum_sum(A: int, B: int, C: int, K: int) -> int:
    A, B, C = sorted([A, B, C])
    return A + B + C * (2 ** K)


if __name__ == "__main__":
    A, B, C = map(int, input().split())
    K = int(input())
    ans = maximum_sum(A, B, C, K)
    print(ans)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
li = [A, B, C]
i = 0
result = 0
while i != K:
    idx = li.index(max(li))
    li[idx] *= 2
    result = sum(li)
    i += 1
print(result)

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

a = [A,B,C]
a.sort()
print(a[0]+a[1]+a[2]*pow(2,K))

Submission status: Accepted

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

print(2**K*c+a+b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=list(map(int, input().split()))
k=int(input())
m=max(l)
del l[l.index(m)]

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

print(m+sum(l))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(sum(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main() -> None:
    A, B, C = map(int, input().split())
    K = int(input())
    m = [A, B, C]
    m.sort(reverse=True)
    ans = m[0] * (2 ** K)
    ans += sum(m[1:])
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

def main():
	tmp = input().split(" ")
	nums = [int(s) for s in tmp]
	counts = int(input())
	
	max_num = max(nums)
	for _ in range(counts):
		for i, val in enumerate(nums):
			if val == max_num:
				nums[i] = val * 2
				max_num = nums[i]
			
	print(nums[0] + nums[1] + nums[2])
		
if __name__ == "__main__":
	main()

Submission status: Accepted

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

ma = max(A, B, C)
ans = A + B + C - ma
ans += ma * (2 ** K)

print(ans)

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:
# python template for atcoder1
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
l = list(map(int, input().split()))
K = int(input())
ans = sum(l)-max(l)
ans += max(l)*(2**K)
print(ans)

Submission status: Accepted

Solution code:
arr=sorted(list(map(int,input().split())))[::-1]
n=int(input())
for i in range(n):
  arr[0]=max(arr)*2
  arr=sorted(arr)[::-1]
print(sum(arr))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A = sorted([int(i) for i in input().split()])

n = int(input())

m = A.pop()
print(sum([m*2**n]+A))

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc096/tasks/abc096_b
abc = [int(x) for x in input().split()]
k = int(input())
abc.sort()
abc[-1] = abc[-1] * (2 ** k)
print(sum(abc))

Submission status: Accepted

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

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

Submission status: Accepted

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

for x in range(0,K):
    answer *= 2

answer += A + B + C - max(A,B,C)

print(answer)

Submission status: Accepted

Solution code:
A, B ,C = sorted(map(int, input().split()))
for _ in range(int(input())):
    C = C * 2
print(A + B + C)

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  A = list(map(int, input().split()))
  K = int(input())
  
  A = sorted(A)
  ans = A[0] + A[1] + A[2] * 2**K
  print(ans)


if __name__ == '__main__':
  main()

Submission status: Accepted

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

if(a>=b and a>=c):
  a=a*2**k
elif(b>=a and b>=c):
  b=b*2**k
else:
  c=c*2**k
  
print(int(a+b+c))

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
m=0
for i in range(k+1):
    for j in range(k+1-i):
        s=a*(2**i)+b*(2**j)+c*(2**(k-i-j))
        if m<s:
            m=s
print(m)

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:
*a,b=list(map(int,open(0).read().split()));print(sum(sorted(a)[:2])+max(a)*2**b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

abcmax=max(a,b,c)
new_abcmax=abcmax

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

print(a+b+c+new_abcmax-abcmax)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
int_a, int_b, int_c = list(map(int, input().split()))
int_k = int(input())


ar_order = sorted([int_a, int_b, int_c], reverse=True)

int_max = ar_order.pop(0)

for n in range(int_k):
    int_max *= 2


print(int_max + sum(ar_order))

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split(" "))
K = int(input())
list = [A,B,C]
list = sorted(list,reverse = True)
for i in range(K):
    list[0] = list[0]*2
#print(list)
print(sum(list))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
n = int(input())
a.sort()
A = a[2]
for i in range(n):
    A *= 2
a.pop(2)
print(a[0]+a[1]+A)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    K = list(map(int, lines.pop(0).split(' ')))
    N = int(lines.pop(0))
    K.sort()
    a = K.pop(-1)
    print(a * 2**N + sum(K))


#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]
#
# solve !!
#
solve(lines)

Submission status: Accepted

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

for k in range(K):
    abc_list.sort(reverse = True)
    abc_list[0] = abc_list[0] * 2

print(sum(abc_list))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 11 05:38:56 2019

@author: shinjisu
"""


# ABC 200点問題
import math


def getInt(): return int(input())


def getIntList(): return [int(x) for x in input().split()]


def zeros(n): return [0]*n


def dmp(x):
    global debug
    if debug:
        print(x)


debug = True


def getIntLines(n): return [int(input()) for i in range(n)]


def getIntMat(n):
    mat = []
    for i in range(n):
        mat.append(getIntList())
    return mat


def zeros2(n, m): return [zeros(m)]*n


def prob095():
    X = getIntList()
    K = getInt()
    dmp((X, K))
    total = sum(X) - max(X) + max(X)*2**K
    return total


debug = False
print(prob095())

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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


main()

Submission status: Accepted

Solution code:
def main():
    abc = list(map(int, input().split()))
    K = int(input())
    m = max(abc)
    abc.remove(m)
    print(sum(abc) + m * 2 ** K)


main()

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:
l=sorted(list(map(int,input().split())))
k=int(input())
#print(l,k)
l[2]=(2**k)*l[2]
print(sum(l))

Submission status: Accepted

Solution code:
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())|	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import collections
def inpl(): return list(map(int, input().split()))

#### START
a, b, c = map(int,input().split())
k = int(input())
m = max([a, b, c])

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

Submission status: Accepted

Solution code:
x=[int(i) for i in input().split()]
x.sort()
n=int(input())
print(x[2]*2**n+x[0]+x[1])

Submission status: Accepted

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

maxABC = max(ABCs)
print(sum(ABCs) - maxABC + maxABC*2**K)

Submission status: Accepted

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

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:
numbers = list(map(int,input().split()))
k = int(input())
for _ in range(k):
    max_pos = numbers.index(max(numbers))
    numbers[max_pos] *= 2
print(sum(numbers))

Submission status: Accepted

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

    # ans = 0
    # for i, m in enumerate(sorted([a, b, c], reverse=True)):
    #     if i == 0:
    #         ans += m * (2 ** k)
    #     else:
    #         ans += m
    #
    # print(ans)

    mx = max(v)
    v.remove(mx)

    ans = mx * (2 ** k) + sum(v)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

    ans = 0
    for i, m in enumerate(sorted([a, b, c], reverse=True)):
        if i == 0:
            ans += m * (2 ** k)
        else:
            ans += m

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
abclist = [int(x) for x in input().split()]
k = int(input())
abclist.sort(reverse=True)
abclist[0] = abclist[0] * (2**k)
print(sum(abclist))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""AtCoder"""

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

abc.sort()

for _ in range(K):
    abc[2] = abc[2] * 2

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
m = max(L)
print(sum(L)-m + m* (2 ** K))

Submission status: Accepted

Solution code:
L = [list(map(int,input().split()))]
K = int(input())
import copy

def peice_double(L):
    l = []
    for x in L:
        tmp = copy.copy(x)
        for i in range(3):
            tmp[i] = tmp[i] * 2
            l.append(copy.copy(tmp))
            tmp[i] = tmp[i] // 2
    return l
for i in range(K):
    L = peice_double(L)
ans = 0
for x in L:
    ans = max(ans, sum(x))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

res += sum((a,b,c)) + max(a,b,c)*(2**k) - max(a,b,c)

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

max = sorted([A,B,C])[2]

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

Submission status: Accepted

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

Submission status: Accepted

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

for _ in range(k):
    x *= 2
    
print(sum(A) - max(A) + x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    na = list(map(int, input().split()))
    A, B, C = na[0], na[1], na[2]
    K = int(input())

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


if __name__ == '__main__':
    main()

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:
def a(abc,k):
    return abc[-1]*2**k+abc[0]+abc[1]
print(a(sorted([int(i) for i in input().split()]),int(input())))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def piyo():
    hoge = list(int(i) for i in input().split())  
    n = int(input())
    m = hoge.index(max(hoge))
    for _ in range(n):
        hoge[m] = hoge[m]*2
    print(sum(hoge))
        
if __name__ == '__main__':
    piyo()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=[int(_) for _ in 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:
import sys
A,B,C = [int(n) for n in input().split()]
K = int(input())
ans = A+B+C + max(A,B,C)*(2**K-1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

max_n = max(a, b, c)

n = int(input())

ans = max_n*2**n + a+b+c-max_n

print(ans)

Submission status: Accepted

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

i = 2 ** K
a = A * i + B + C
b = A + B * i + C
c = A + B + C * i

print(max(a, b, c))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline

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

ans = sum(lst_abc) + max(lst_abc) * (pow(2, K) - 1)
print(ans)

Submission status: Accepted

Solution code:
a, b, c = list(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())

black_board=[A,B,C]
for i in range(K):
    max_index=black_board.index(max(black_board))
    black_board[max_index]*=2
sum=0
for i in range(len(black_board)):
    sum+=black_board[i]

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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=input().strip().split(" ")
A=[int(i) for i in A]
K=int(input())
count=0

A.sort()

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

for i in range(3):
    count+=A[i]

print(count)

Submission status: Accepted

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


def main():
    """Function."""
    num = list(map(int, input().split()))
    k = int(input())

    max_num = max(num)
    rest = sum(num) - max_num
    for _ in range(k):
        max_num *= 2

    print(rest + max_num)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a, b, c = sorted(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())
if(A==max(A,B,C)):
    print(A*(2**K)+B+C)
elif(B==max(A,B,C)):
    print(A+B*(2**K)+C)
else:
    print(A+B+C*(2**K))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
abc = [int(n) for n in input().split()]
K = int(input())

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = int(input())
a.sort()
c = a[::-1]
d = c[0]


for i in range(b):
    c[0] +=c[0]
print(sum(c))

Submission status: Accepted

Solution code:
def main():
    xs = sorted(map(int, input().split()))
    k = int(input())
    for _ in range(k):
        xs[-1] *= 2
    print(sum(xs))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions
def j(a):
    if a==1: print("Yes")
    else :print("No")


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#x = ip()                              #入力整数1つ
#x,y = (int(i) for i in input().split())      #入力整数横2つ
#x,y,z = (int(i) for i in input().split())    #入力整数横3つ
#a,b,c,k = (int(i) for i in input().split())  #入力整数横4つ
a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

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

Submission status: Accepted

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

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

Submission status: Accepted

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

max_v = max(li)
max_i = li.index(max_v)
for i in range(K) :
    max_v *= 2

li[max_i] = max_v
print(sum(li))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A,B,C=map(int,input().split())
K = int(input())
S = max(A,B,C) #入力された整数の最大のものを選ぶ
L = [A,B,C] #入力された整数のリスト化
L.remove(S)
P = sum(L , S*2**K)
print(P)

Submission status: Accepted

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