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

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())
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())
m = max(a, b, c)

for i in range(k):
  m *= 2
  
print(sum([a, b, c]) - max(a, b, c) + m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C = map (int, input ().split ())
S = int (input ())
if A>B>C or A>C>B:
  for i in range (S):
    A = A*2
  print (A+B+C)
elif B>A>C or B>C>A:
  for i in range (S):
    B = B*2
  print (A+B+C)
else:
  for i in range (S):
    C = C*2
  print (A+B+C)

Submission status: Accepted

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

a.sort()

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

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:
l = list(map(int, input().split()))
k = int(input())
i = l.index(max(l))
m = l[i]
del l[i]
l.append(m * 2 ** k)
print(sum(l))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
D=[A,B,C]
a=0
K=int(input())
a+=(max(D)*(2**K))
D.remove(max(D))
for i in range(2):
    a+=D[i]
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

max = 0
index = -1
for i in num_list:
    if max < i:
        max = i
        index = num_list.index(i)

change = max*(2**k)
num_list[index] = change
ans = 0
for j in num_list:
    ans += j

print(ans)

Submission status: Accepted

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

a.sort()
a[-1] *= 2 ** k

print(sum(a))

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    ABC = LI()
    K = I()
    ABC.sort()

    ans = sum(ABC[:2]) + ABC[2] * 2 ** K
    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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


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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

abc.sort(reverse=True)

abc[0] = abc[0] * (2 ** k)

print(sum(abc))

Submission status: Accepted

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

Submission status: Accepted

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

A, B, C = LI()
K = int(input())


def main():
    l = [A, B, C]
    l.sort()
    l[-1] *= 2 ** K
    ans = sum(l)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(sum(abc))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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:
ls = list(map(int,input().split()))
K = int(input())
ls.sort()
ans = ls[0]+ls[1]+ls[2]*2**K
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum(lst))

Submission status: Accepted

Solution code:
a = list(map(int, input("").split()))
k=int(input())
m=0
if a[1] >= a[0] or a[2] >= a[0]:
    if a[2] >= a[1]:
        m=2
    else:
        m=1
for i in range(k):
    a[m]=a[m]*2
print(a[0]+a[1]+a[2])

Submission status: Accepted

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

print(sum(num))

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

m = max(a,b,c)

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

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

print(ans)

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:
abc = list(map(int, input().split()))
k = int(input())
mx = max(abc)
x2 = mx
for i in range(k):
    x2 *= 2
print(x2 + sum(abc) - mx)

Submission status: Accepted

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

    l = [A, B, C]
    l.sort(reverse=True)
    for i in range(K):
        l[0] = l[0] * 2
    print(sum(l))
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = rl()
max_ = max(li)
k = ri()
li.remove(max_)
print(sum(li) + max_ * 2**k)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A = list(map(int, readline().split()))
    K = int(readline())

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

    print(sum(A))

    return


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
X = list(map(lambda x: int(x), input().split(" ")))
K = int(input())

X.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    A, B, C = map(int, readline().split())
    K = int(readline())
    print(max(A, B, C) * 2**K + A+B+C-max(A,B,C))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
input_ = [int(s) for s in input().split()]
k = int(input())
input_.sort(key=int)
for _ in range(k):input_[2] *= 2
ans = 0
for i in range(3):ans += input_[i]
print(ans)

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:
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:
def solve():
  A, B, C = map(int, input().split())
  K = int(input())
  ans = A+B+C+max([A,B,C])*(pow(2,K)-1)
  return ans
print(solve())

Submission status: Accepted

Solution code:
data = list(map(int, input().split()))
k = int(input())
if k == 1:
    print( sum(data) + max(data) )
else:
    tmp = max(data)
    for _ in range(k):
        tmp = tmp * 2
    print( sum(data) + tmp - max(data) )

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

import math

X = sorted(MAP())
K = INT()
ans = X[0] + X[1]
ans += X[2] * math.pow(2, K)
print(int(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

ABC = [a, b, c]
sort_ACB = sorted(ABC)
MAX = sort_ACB[-1]
sum_ABC = sum(ABC) - MAX

for _ in range(k):
  MAX*=2
print(sum_ABC + MAX)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C =map(int,input().split())
K = int(input())
l = [A,B,C]
sl = sorted(l)
#print(sl)

for i in range(K):
    sl[-1] *= 2

#print(sl)
print(sum(sl))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# print(abc)
# print(k)

# print(max(abc))
# print(abc.index(max(abc)))
max_index = abc.index(max(abc))

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

# print(abc)
print(sum(abc))

Submission status: Accepted

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

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

print(a + b + c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])

v = input()
k = int(v)

max_index = 0

array = []
array.append(a)
array.append(b)
array.append(c)


for i in range(k):
    array.sort()
    x = array.pop()
    x *= 2
    array.append(x)


answer = 0
for i in range(len(array)):
    answer += array[i]

print(answer)

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

Submission status: Accepted

Solution code:
MM = input().split()
A = int(MM[0])
B = int(MM[1])
C = int(MM[2])
K = int(input())
S = [A,B,C]
S.sort()

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

total =0
for i in S:
  total += i
print(total)

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

ini = [A,B,C]
from itertools import permutations, combinations,combinations_with_replacement,product
a=['A','B','C']
Ls = list(combinations_with_replacement(a,K))

ans=0
for L in Ls:
    ini=[A,B,C]
    # print('ini:',ini)
    # print('L:',L)
    for i in L:
        # print('i:',i)
        if i=='A':
            ini[0]*=2
        elif i=='B':
            ini[1]*=2
        elif i=='C':
            ini[2]*=2
    ans=max(ans,sum(ini))
    # print('ans:',ans)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b, c, k = map(int, read().split())
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())
a.sort()
print(sum(a[0:2])+a[2]*(2**k))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Num = sorted([int(X) for X in input().split()])
K = int(input())
print(Num[0]+Num[1]+Num[2]*pow(2,K))

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
number = list(map(int,input().split()))
K = int(input())
number.sort(reverse=True)
print(number[0]*(2**K)+number[1]+number[2])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    ABC = il()
    N = ii()
    m = max(ABC)
    for n in range(N):
        m*=2
    print(sum(ABC) + m - max(ABC))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
def main():
  a,b,c = list(map(int,input().split()))
  k = int(input())
  if a<b:
    if b<c:
      print(a+b+c*pow(2,k))
    else:
      print(a+b*pow(2,k)+c)
  else:
    if a<c:
      print(a+b+c*pow(2,k))
    else:
      print(a*pow(2,k)+b+c)
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

K = int(input())

num = 0
ans = A+B+C
while True:
    num += 1
    ans += max(A,B,C)*(2**(num-1))
    if num == K:
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
array_abc = list(map(int,input().split()))
K = int(input())

if not ( 1 <= min(array_abc),max(array_abc) <= 50 ):
    sys.exit()
if not ( 1 <= K <= 10 ):
    sys.exit()

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

Submission status: Accepted

Solution code:
import sys
array_abc = list(map(int,input().split()))
K = int(input())

if not ( 1 <= min(array_abc),max(array_abc) <= 50 ):
    sys.exit()
if not ( 1 <= K <= 10 ):
    sys.exit()

option = max(array_abc)
for I in range(K):
    option = option * 2

print(sum(array_abc) + option - max(array_abc))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
k = int(input())
mx = max(l)
ans = sum(l) - mx
for _ in range(k):
    mx *= 2

print(ans+mx)

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:
import sys
def input(): return sys.stdin.readline().strip()


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

    def dfs(k):
        if k == 0: return sum(A)
        A[0] *= 2
        cand1 = dfs(k - 1)
        A[0] //= 2
        A[1] *= 2
        cand2 = dfs(k - 1)
        A[1] //= 2
        A[2] *= 2
        cand3 = dfs(k - 1)
        A[2] //= 2
        return max(cand1, cand2, cand3)

    print(dfs(K))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    num_list = i_list()
    k = i_input()

    num_list.sort()

    count = 0
    for i in range(3):
        if i == 2:
            tmp = num_list[2]
            for j in range(k):
                tmp *= 2
            count += tmp
        else:
            count += num_list[i]

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

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

for i in range(K):
  x = a.index(max(a))
  a[x] *= 2
  i += 1
  
print(sum(a))

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
for _ in range(k):
    m=max(a,b,c)
    if m==a:
        a*=2
    elif m==b:
        b*=2
    else:
        c*=2
print(sum([a,b,c]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def actual(a, b, c, k):
    # 2倍されるのは 1つの数字に限られるので、そいつだけを2倍していけばいい
    max_num = max((a, b, c))
    repetition = (2 ** k - 1)
    
    return a + b + c + (max_num * repetition)

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

print(actual(a, b, c, k))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = sorted(map(int, input().split()))
K = int(input())
#黒板に書かれている整数のうち 1 つを選び, これを 2 倍した値に書き換える. 
print(A + B + C*2**K)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    ABC = sorted(il())
    mx = max(ABC)
    K = ii()

    for k in range(K):
        mx *= 2
    print(ABC[0] + ABC[1] + mx)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    max_v = max(A, B, C)

    ans = sum((A, B, C)) - max_v + max_v * 2 ** K
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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