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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

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

l = [a,b,c]
l.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = list(map(int, input().split()))
k = int(input())
ans = 0
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:
li = list(map(int, input().split()))
k = int(input())
li = sorted(li)

print(li[-1]*(2**k)+li[0]+li[1])

Submission status: Accepted

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

if ma == a:
  print(a*(2**k)+b+c)
elif ma == b:
  print(b*(2**k)+a+c)
elif ma == c:
  print(c*(2**k)+a+b)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A = [int(x) for x in input().split()]
K = int(input())
m = 2 ** K
A.sort()
print(A[0] + A[1] + m * A[2])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#N = int(input())
L = list(map(int, input().split()))
K = int(input())
L.sort(reverse=True)

sum = L[0]
for _ in range(K) :
  sum *= 2
sum += L[1]
sum += L[2]

print (sum)

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:

v = list(map(int,input().split()))
k = int(input())

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

print(sum(v))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(a+b+c)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

*a, k = map(int, sys.stdin.read().split())

def main():
    a.sort()
    return sum(a[:2]) + a[-1] * 2 ** k

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

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

mx = max(a,b,c)
lis = [a,b,c]
lis.remove(mx)
#print(sum(lis))

print(mx*2**k+sum(lis))

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

n[-1] = n[-1]*(2**k)
print(sum(n))

Submission status: Accepted

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

for _ in range(k):
    n[-1] = n[-1]*2

print(sum(n))

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
N = [A, B, C]
for i in range(K):
  n = N.index(max(N))
  N[n] = 2 * N[n]
print(sum(N))

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
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())
p = [a,b,c]
p.sort()
x = p[0]
y = p[1]
z = p[2]
ans = p[0]+p[1] +p[2]*2**(k)
print(ans)

Submission status: Accepted

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

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

print(a + b + c - m + (m * 2 ** k))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
n = list(map(int, input().split()))
num = sorted(n)
k = int(input())
ans = 0

for _ in range(k):
    ans = sum(num[0:2]) + num[2]*2
    num[2] = num[2]*2

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


print(sum(li))

Submission status: Accepted

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

print(NN[0] * 2 ** K + sum(NN[1:]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

a.sort()

memo = 1<<k

print(a[0]+a[1]+a[2]*memo)

Submission status: Accepted

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


def solve(A: int, B: int, C: int, K: int):
    print(max([A, B, C]) * (2 ** K) + sum([A, B, C]) - max([A, B, C]))


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a,b,c = map(int,input().split())
k = int(input())

"""
for i in range(k):
    D = [a,b,c]
    D.sort()
    D[2] = 2 * D[2]
ans = a + b + c
print(ans)
"""

D = [a,b,c]
D.sort()
ans = D[0] + D[1] + D[2] * 2 ** k
print(ans)

Submission status: Accepted

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

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

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

print(sum(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
boad = [int(i) for i in input().split()]
k = int(input())
boad.sort()
for i in range(k):
    boad[2] *= 2

ans = 0
for i in range(3):
    ans += boad[i]
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

if max(A,B,C) == A:
    A = A*(2**K)
elif max(A,B,C) == B:
    B = B*(2**K)
elif max(A,B,C) == C:
    C = C*(2**K)
    
print(sum([A,B,C]))

Submission status: Accepted

Solution code:

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

n = int(input())

ans = max(a,b,c)

for i in range(n):
	ans = ans*2

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(K):
	num.sort(reverse=True)
	num[0] *= 2
print(sum(num))

Submission status: Accepted

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

ans = a + b + c

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
##### 解けた #####

V=list(map(int,input().split(" ")))
K=int(input())
Vs=sorted(V) # 大きさでソートする

print(Vs[2]*2**K+sum(Vs[:2]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = (int(i) for i in input().split())
K = int(input())
if A < B: A, B = B, A
if A < C: A, C = C, A
for i in range(K): A *= 2
print(A + B + C)

Submission status: Accepted

Solution code:
def examB():
    ABC = LI()
    K = I()
    ans = sum(ABC) + max(ABC)*(2**K-1)
    print(ans)


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = 1
count = 0

a,b,c=map(int,input().split())
k=int(input())
bi=2**k
print(a+b+c+max(a,b,c)*(bi-1))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
A=  np.array(list(map(int, input().split())))
n = int(input())
f = np.argmax(A)
A[f] = A[f]*2**n
print(A.sum())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
K=int(input())
max_=max(A,B,C)
ans=A+B+C
for i in range(K):
  ans+=max_
  max_+=max_
print(ans)

Submission status: Accepted

Solution code:
nums = []
nums.extend([int(x) for x in input().split()])
mult = int(input())
maxi = max(nums)
nums.remove(maxi)
print(sum(nums) + maxi*(2**mult))

Submission status: Accepted

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

n = max(a,max(b,c))

if n == a:
	print((2**k)*n+b+c)
elif n == b:
	print((2**k)*n+a+c)
else:
	print((2**k)*n+a+b)

Submission status: Accepted

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

def main():
    A,B,C = map(int, input().split())
    K = int(input())
    max_val = max(A,B,C)
    baisu = 0
    for i in range(K):
        if i == 0:
            baisu = max_val * 2
        else:
            baisu = baisu * 2
    print(A+B+C - max_val + baisu)
    

if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B, C = MAP()
K = INT()

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

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:
from sys import stdin

li = list(map(int,stdin.readline().rstrip().split()))
n = int(stdin.readline().rstrip())
li.sort()
li[2] *= 2**n
    
print(sum(li))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 096: B – Maximum Sum
a, b, c = [int(s) for s in input().split()]
k = int(input())

sum_of_integers = a + b + c

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ls=[int(s) for s in input().split()]
K=int(input())
ls.sort()
for i in range(K):
  ls[2]*=2
print(ls[0]+ls[1]+ls[2])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

res = 0
for i in range(3):
  if(i == 2):
    res += s[i] * (2 ** k)
  else:
    res += s[i]
print(res)

Submission status: Accepted

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

def solve(a,b,c,k):
    lst = [a,b,c]
    for i in range(k):
        ind = lst.index(max(lst))
        lst[ind] = lst [ind] * 2
    return sum(lst)




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# B - Maximum Sum
A = list(map(int, input().split()))
K = int(input())
A.sort(reverse=True)

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
l = [int(num) for num in input().split()]
K = int(input())
a = max(l)
for _ in range(K):
  a = a * 2

l.sort()
l[len(l)-1] = a
print(sum(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(nums))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def main():
    A = list(map(int, input().split()))
    K = int(input())
    A.sort()
    A[-1] *= 2**K
    print(sum(A))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-07 13:09:56(JST)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator

def main():
    *n, k = (int(x) for x in sys.stdin.read().split())
    n.sort()
    total = n[0] + n[1] + n[2] * 2 ** k
    print(total)


if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
import sys,bisect,math,itertools,string,queue
from heapq import heappop, heappush
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a = inpl()
k = inp()
a.sort()
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(A+B+C+M*(2**K-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:
A, B, C = map(int, input().split())
K = int(input())

n = max(A,B,C)
s = n
for i in range(1,K+1):
    s = s*2

print(s+A+B+C-n)

Submission status: Accepted

Solution code:
import math
import sys
input = sys.stdin.readline


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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
abc= list(map(int, input().split()))
K = int(input())
for i in range(K):
    t = abc.index(max(abc))
    abc[t] = 2 * abc[t]
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 + a + b + c - max(a, b, c))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
A = list(map(int, input().split()))
k = int(input())
A[A.index(max(A))] *= 2 ** k

print(sum(A))

Submission status: Accepted

Solution code:
n = [int(i) for i in input().split()]
k = int(input())
n.sort()
for i in range(k):
  n[2] *= 2
result = sum(n)
print(result)

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
k = int(input())
b = max(a)
a.remove(b)
for i in range(1,k+1):
    b *= 2
a.append(b)
print(sum(a))

Submission status: Accepted

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

Submission status: Accepted

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

i=max(a,b,c)

x=i*(2**k)

print(a+b+c+x-i)

Submission status: Accepted

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

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

print(sum(ABC))

Submission status: Accepted

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

Submission status: Accepted

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

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

# solve & output
print(A + B + C + (max(A, B, C) * ((1 << K) - 1)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a>=b and a>=c:
    ans = a
    cou = a
elif b>=a and b>=c:
    ans = b
    cou=b
else:
    ans = c
    cou=c
for i in range(k):
    count=ans*2
    ans = count
if cou==a:
    print(ans+b+c)
elif cou==b:
    print(ans+a+c)
else:
    print(ans+b+a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(a, b, c, k):
    l = [a, b, c]
    for _ in range(k):
        l[l.index(max(l))] = max(l)*2

    print(sum(l))


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

    main(a, b, c, 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())

U=[A,B,C]
U.index(max(U))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

M=L.index(max(L))
L[M]*=2**K

print(sum(L))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
     A, B, C = map(int, input().split())
     K = int(input())
     v = [A, B, C]
     v.sort(reverse = True)
     return pow(2, K)*v[0] + v[1] + v[2]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
n = int(input())
t = max(a)
for i in range(n):
	t*=2

ans = t + sum(a) -max(a)
print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum(n))

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

Submission status: Accepted

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

Submission status: Accepted

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

ABC.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

hoge = max([a,b,c])
ot =a + b +c -hoge

print(ot+hoge*(2**k))

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
K = int(input())
M = max(A,B,C)
tmp = M
for _ in range(K):
    M += M
print(A+B+C+M-tmp)