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

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

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:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
A, B, C = ri_()
K = ri()
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())

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

print(s+m)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = list(map(int, input().split()))
k = int(input())
k = 2**k
tmp = sorted(num)

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

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
n = int(input())
m = max(a,b,c)
def bai(x):
  return 2*x

for i in range(n):
  m = bai(m)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

a,b,c=MI()
k=I()
ans=a+b+c+max(a,b,c)*(2**k-1)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

A[-1] *= 2**k

print(sum(A))

Submission status: Accepted

Solution code:
l = list(map(int,input().split()))
k=int(input())
n_l = sorted(l,reverse=True)

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

print(sum(n_l))

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
k=int(input())
lis=[]
for i in range(0,k+1):
  for j in range(0,k-i+1):
      atai=a*(2**i)+b*(2**j)+c*(2**(k-i-j))
      if not atai in lis:
        lis.append(atai)
lis.sort()
print(lis[-1])

Submission status: Accepted

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

for i in range(1,k+1):
       f=a[2]*2
       a[2]=f
       
c=a[0]+a[1]+a[2]
print(c)

Submission status: Accepted

Solution code:
def f(a, b, c, k):
    abc = sorted([a, b, c])
    if k != 0:
        abc[2] *= 2 ** k
    print(sum(abc))

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

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

Submission status: Accepted

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

d = max(a,b,c)

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

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

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:
def main():
    t = list(map(int, input().split()))
    n = input()
    for i in range(int(n)):
        ind = t.index(max(t))
        t[ind] = t[ind] * 2
    print(sum(t))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

ans = a+b+c+n*(2**k-1)

print(ans)

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 accumulate, permutations, combinations, product, groupby
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
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

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

Submission status: Accepted

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

Submission status: Accepted

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

for _ 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:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

for i in range(K):
    l = sorted(l,reverse=True)
    l[0] = l[0] * 2
print(sum(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
li = sorted(map(int, input().split()))
k = int(input())
for i in range(k):
    tmp = li.pop()
    bisect.insort(li, tmp * 2)
print(sum(li))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    a, b, c = nm()
    k = ni()

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

    print(arr.pop()*2**k + sum(arr))


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
List = sorted([int(i) for i in input().split(" ")],reverse=True)
K = int(input())
List[0] = List[0]*(2**K)
print(sum(List))

Submission status: Accepted

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

A.sort()

ans = sum(A[0:2]) + A[2] * 2 ** (k)
print(ans)

Submission status: Accepted

Solution code:

a = list(map(int,input().split()))
k = int(input())
a.sort()
a[-1] = a[-1] * (2**k)
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 = 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:
icase=0
if icase==0:
    a,b,c=map(int,input().split())
    k=int(input())
    xmax=max(a,b,c)
    xx=xmax*2**k+a+b+c-xmax
    print(xx)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(k):
    al[0] = al[0] * 2
    bl[1] = bl[1] * 2
    cl[2] = cl[2] * 2

sm = [sum(al), sum(bl), sum(cl)]
print(max(sm))

Submission status: Accepted

Solution code:
def main():
    A, B, C = map(int, input().split())
    K = int(input())
    for i in range(K):
        if A >= B and A >= C:
            A = 2*A
        if B >= A and B >= C:
            B = 2*B
        if C >= A and C >= B:
            C = 2*C
    print(sum([A, B, C]))
main()

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

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

print(sum(li))

Submission status: Accepted

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

a.sort()

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

Submission status: Accepted

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

biggest = ABC.index(max(ABC))
ans = sum(ABC) - ABC[biggest] + ABC[biggest] * 2 ** K

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    abc = MII()
    k = II()
    maxv = max(abc)
    sumv = sum(abc) - maxv
    for i in range(k):
        maxv *= 2
    sumv += maxv
    print(sumv)


if __name__ == '__main__':
    main()

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()))
s = sum(A)-max(A)
n = int(input())
s+=max(A)*2**n
print(s)

Submission status: Accepted

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


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

print(sum(X))

Submission status: Accepted

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

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

Submission status: Accepted

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

K=int(input())
for i in range(K):
  abclist[2]*=2
  
print(sum(abclist))

Submission status: Accepted

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

abc.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    A, B, C = list(map(int, input().split(" ")))
    K = int(input())
    m = max(A, B, C)
    mul = m * 2 ** K
    print(sum([A, B, C]) - m + mul)

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

a.sort()
b=a.pop()
b=b*2**k
a.append(b)
print(sum(a))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
L = [int(num) for num in input().split()]
K = int(input())
L.sort()
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(A+B+C+max(A,B,C)*2**K-max(A,B,C))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = input()
a, b, c = [int(n) for n in line.split()]
k = int(input())
numbers = [a, b, c]
numbers.sort(reverse=True)
numbers[0] *= 2 ** k
print(sum(numbers))

Submission status: Accepted

Solution code:
line = input()
a, b, c = [int(n) for n in line.split()]
k = int(input())
numbers = [a, b, c]
numbers.sort()
numbers[-1] *= 2 ** k
print(sum(numbers))

Submission status: Accepted

Solution code:
l = sorted(map(int, input().split()))
for _ in range(int(input())):
    l[2] *= 2
    l.sort
print(sum(l))

Submission status: Accepted

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

for _ 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, b, c = map(int, input().split())
d = int(input())
l = [a, b, c]
for _ in range (d):
    index = l.index(max(l))
    l[index] = l[index] * 2
print(sum(l))

Submission status: Accepted

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

while k>0:
    if a>=b and a>=c:
        a = a*2
        soma = a+b+c
    elif b>=a and b>=c:
        b = b*2
        soma = a+b+c
    else:
        c = c*2
        soma = a+b+c
    k = k-1

print(soma)

Submission status: Accepted

Solution code:
numeros = input()
numeros = numeros.split()
numeros = [int(i) for i in numeros]
nVezes = int(input())
for x in range(nVezes):
    for y in range(len(numeros)):
        if(numeros[y] == max(numeros)):
            numeros[y] = numeros[y] * 2

print(sum(numeros))

Submission status: Accepted

Solution code:
numeros = [int(x) for x in input().split()]
k = int(input())
index_maior = 0
maior = numeros[0]
for index, value in enumerate(numeros):
    if value > maior:
        maior = value
        index_maior = index
for _ in range(k):
    numeros[index_maior] *= 2
print(sum(numeros))

Submission status: Accepted

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

aux=max(A, B, C)
ans=(A+B+C)-aux

for _ in range(K):
  aux+=aux

print(aux+ans)

Submission status: Accepted

Solution code:
line = input()
nums = [int(n) for n in line.split()]
nums.sort()
k = int(input())
n = nums[-1]
for _ in range(k):
    n*=2
for num in nums[:2]:
    n+=num
print(n)

Submission status: Accepted

Solution code:
num = input()
A = int(num.split(' ')[0])
B = int(num.split(' ')[1])
C = int(num.split(' ')[2])
K = int(input())
num = [A,B,C]
while K>0:

    posi = num.index(max(num))
    num[posi]=num[posi]*2

    K=K-1

print(sum(num))

Submission status: Accepted

Solution code:
line = input()
numbers = [int(n) for n in line.split()]
numbers.sort()
K = int(input())
N = numbers[-1]
for _ in range(K):
    N*=2
for num in numbers[:2]:
    N+=num
print(N)

Submission status: Accepted

Solution code:
line = input()

a = [int(n) for n in line.split()]

k = int(input())

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

for i in range(k-1):
    largest = largest * 2

a[-1] = largest
print(sum(a))

#k = int(input())


#z = a+b+x
#
#if x < a:
#    print("NO")
#elif x > a+b:
#    print("NO")
#elif x <= a+b:
#    print("YES")
#

Submission status: Accepted

Solution code:
line = input()

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

max_val = max(a, b, c)
max_val_mem = max_val

amax = False
bmax = False
cmax = False

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

if max_val_mem == a:
    amax = True
    print(str(max_val+ b+ c))
elif max_val_mem == b:
    bmax = True
    print(str(max_val+ a+ c))
elif max_val_mem == c:
    cmax = True
    print(str(max_val+ a+ b))

Submission status: Accepted

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

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

print(sum(ABC))

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
k = int(input())
a.sort()
for i in range(k):
    a[-1] *= 2
    a.sort()
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 = list(map(int, input().split()))
A.sort(reverse = True)
K = int(input())

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

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:
a, b, c = map(int, input().split())
k = int(input())
list_ANS = [a, b, c]
list_ANS.sort(reverse=True)
d = list_ANS.pop(0)
for _ in range(k):
    d *= 2
list_ANS.append(d)
print(sum(list_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:
num = sorted(list(map(int, input().split())))
k = int(input())
for i in range(k):
    num[-1] *= 2
print(sum(num))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  List = list(map(int,input().split()))
  k = int(input())
  
  List = sorted(List,reverse=True)
  for _ in range(k):
    List[0] *= 2
  print(sum(List))
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

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

print(sum(A))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# abc096_b.py
A = list(map(int,input().split()))
A.sort(reverse=True)
N = int(input())
ans = 0
for i,v in enumerate(A):
    if i == 0:
        ans += v*(2**N)
    else:
        ans += v
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, 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())
print((max([a,b,c]))*(2**k-1)+sum([a,b,c]))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=list(map(int,input().split()))
K=int(input())
B=sorted(A)
print(B[0]+B[1]+B[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:
l = list(map(int, input().split()))
k = int(input())
MAX = max(l)
print(sum(l) + MAX * 2 ** k - MAX)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import math
import itertools
import statistics
#import numpy as np
#import collections
A, B, C = list(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:
A = sorted(map(int, input().split()))
print(sum(A[:2]) + A[-1]*2**int(input()))

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c = iim()
k = ii()

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

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(j) for j in input().split()]
from collections import Counter
#template
#issueから始める
li = inputlist()
K = int(input())
li.sort()
li[-1] = li[-1]*2**K
print(sum(li))

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

Submission status: Accepted

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

b = a.index(max(a))

ans = 0
for i in range(3):
    if (i == b):
        ans += a[i] * (2 ** k)
    else:
        ans += a[i]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C=list(map(int,input().split()))
K=int(input())
m=max([A,B,C])
k=m
for i in range(1,K+1):
    k=k*2
print(sum([A,B,C])-m+k)

Submission status: Accepted

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

    A.sort()
    print(sum(A[:-1])+A[-1]*2**k)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def Maximum_Sum(a , b , c , k):

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

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

if __name__ == '__main__':
    main()