Problem:


Score: 200 points

Problem Statement

There are three positive integers A, B and C written on a blackboard. E869120 performs the following operation K times:

Choose one integer written on the blackboard and let the chosen integer be n. Replace the chosen integer with 2n.

What is the largest possible sum of the integers written on the blackboard after K operations?

Constraints

A, B and C are integers between 1 and 50 (inclusive).

K is an integer between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

A B C
K

Output

Print the largest possible sum of the integers written on the blackboard after K operations by E869220.

Sample Input 1

5 3 11
1

Sample Output 1

30

In this sample, 5, 3, 11 are initially written on the blackboard, and E869120 can perform the operation once.

There are three choices:  

Double 5: The integers written on the board after the operation are 10, 3, 11.

Double 3: The integers written on the board after the operation are 5, 6, 11.

Double 11: The integers written on the board after the operation are 5, 3, 22.

If he chooses 3., the sum of the integers written on the board afterwards is 5 + 3 + 22 = 30, which is the largest among 1. through 3.  

Sample Input 2

3 3 4
2

Sample Output 2

22

E869120 can perform the operation twice. The sum of the integers eventually written on the blackboard is maximized as follows:  

First, double 4. The integers written on the board are now 3, 3, 8.  

Next, double 8. The integers written on the board are now 3, 3, 16.  

Then, the sum of the integers eventually written on the blackboard is 3 + 3 + 16 = 22.



Sample input:
5 3 11
1


Sample output:
30

Submission status: Wrong Answer

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

    abc = [a, b, c]
    ma = max(a, b, c)
    ans = 0
    for num in abc:
        if num == ma:
            for i in range(k):
                num *= 2
            ans += num
        else:
            ans += num

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

    abc = [a, b, c]
    ma = max(a, b, c)
    ans = 0
    for num in abc:
        if num == ma:
            ans += num*(2*k)
        else:
            ans += num

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(max_*2*K + A + B + C - max_)

Submission status: Wrong Answer

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    A=sorted(list(map(int,input().split())), reverse=True)
    total=sum(A)
    k=int(input())

    for i in range(1,k+1):
        total+=max(A)*i

    print(total)




resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

m=max(ABC)
s=sum(ABC)-m
print(m*2*K+s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

a, b, c = na()
k = ni()
m = max(a, b, c)
print(a + b + c + m * k * 2 - m)

Submission status: Wrong Answer

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

print(sum(n)+max(n)*k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

res = max_value * k + a + b + c

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ABC[ABC.index(max(ABC))] *= 2 * K
print(sum(ABC))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
k = int(input())
max_num = max(max(a, b), c)#a,b,cの中で一番大きな数が格納される
print(a+b+c+max(max(a, b), c)*k-k)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
li = [int(i) for i in input().split()]
K = int(input())
li.sort()
ans = 0
li[-1] *= K
for i in range(3) :
    ans += li[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
li = [int(i) for i in input().split()]
K = int(input())
li.sort()
ans = 0
li[-1] *= 2 * K
for i in range(3) :
    ans += li[i]
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

mx = max(a,b,c)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 0
for i in range(K+1):
    for j in range(K+1):
        if i+j > K:
            continue

        k = (K-i-j)
        ans = max(ans, (i*2*a if i > 0 else a) + (j*2*b if j > 0 else b) + (k*2*c if k > 0 else c))

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=list(map(int,input().split()))
K=int(input())
NN = sorted(N, reverse=True)
print(sum(NN[0:K]) * 2 + sum(NN[K:]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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()
    c = 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: Wrong Answer

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

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

Submission status: Wrong Answer

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()
    c = 2 * D[2]
ans = a + b + c
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ABC_1 = sorted(ABC)
ABC_2 = ABC_1[:-1]

ABC_MAX = ((max(ABC))*2)**K

ABC_3 = sum(ABC_2)



print((ABC_MAX) + (ABC_3))

Submission status: Wrong Answer

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

ABC_1 = sorted(ABC)
ABC_2 = ABC_1[:-1]

ABC_MAX = ((max(ABC))*2)^K

ABC_3 = sum(ABC_2)



print((ABC_MAX) + (ABC_3))

Submission status: Wrong Answer

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

ABC_1 = sorted(ABC)
ABC_2 = ABC_1[:-1]

ABC_MAX = ((max(ABC))*2)*K

ABC_3 = sum(ABC_2)



print((ABC_MAX) + (ABC_3))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

if a>=b and a>=c:
    ans = a
elif b>=a and b>=c:
    ans = b
else:
    ans = c

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def main():
    v = sorted(map(int, input().split()))
    k = int(input())
    print(sum(v[:-1]) + v[-1] * 2 * k)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

a=sorted(a,reverse=True)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import heapq
A = list(map(int, input().split()))
A = [-a for a in A]
K = int(input())
heapq.heapify(A)
print(A)
for i in range(K):
    max_val = heapq.heappop(A)
    heapq.heappush(A, 2*max_val)

print(sum([-a for a in A]))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(sum(L))

Submission status: Wrong Answer

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

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

print(sum(L))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def main():
	line = input()
	vector = [int(x) for x in line.split()]
	maxim = max(vector)
	k = int(input())
	sum = 0
	for i in range(3):
		if vector[i] == maxim:
			sum += vector[i] * 2 ** k
		else:
			sum += vector[i]
	print(sum)
 
 
 
if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)
for i in range(k+1):
  ans = ans + ans
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
k = int(input())
biggest = max(a, b, c)
rest = []
for i in [a, b, c]:
    if i != biggest:
        rest.append(i)
for i in range(k):
    biggest *= 2
print(sum(rest) + biggest)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

max_abc = ABC_LIST[-1]

ans = ((2*K) * max_abc) + sum(ABC_LIST[:2])

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""


l = list(map(int, sys.stdin.readline().split()))
K =  int(sys.stdin.readline())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a==max(a,b,c):
  for i in range(1,k+1):
    c*2
elif b==max(a,b,c):
  for i in range(1,k+1):
    b*=2
else:
  for i in range(1,k+1):
    c*=2
print(a+b+c)

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

li = na()
k = ni()
print(sum(li) - max(li) + max(li) * 2 * k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

sum(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    abc = list(map(int, input().split()))
    K = int(input())
    for _ in range(K):
        abc_sorted = sorted(abc, reverse=True)
        for num in abc_sorted:
            if num*2 <= 50:
                abc[abc.index(num)] = num*2
                break
    print(sum(abc))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(A + B + C - mx + mx * 2 * K)

Submission status: Wrong Answer

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

for i in range(int(input())):
    num=[l*2 if l==max(num) else l for l in num ]
print(sum(num))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
ABC = list(map(int,input().split()))
K = int(input())
#import numpy as np
#ABC[ABC.index(max(ABC))] = ABC[ABC.index(max(ABC))]*2*K
#print(sum(ABC))
ans = []
ans.append(ABC[0]*2*K+ABC[1]+ABC[2])
ans.append(ABC[0]+ABC[1]*2*K+ABC[2])
ans.append(ABC[0]+ABC[1]+ABC[2]*2*K)
print(max(ans))

Submission status: Wrong Answer

Solution code:
ABC = list(map(int,input().split()))
K = int(input())
#import numpy as np
#ABC[ABC.index(max(ABC))] = ABC[ABC.index(max(ABC))]*2*K
#print(sum(ABC))

a= sum(ABC)+max(ABC)*K*2-max(ABC)
print(a)

Submission status: Wrong Answer

Solution code:
ABC = list(map(int,input().split()))
K = int(input())
import numpy as np
ABC[ABC.index(max(ABC))] = ABC[ABC.index(max(ABC))]*2*K
print(sum(ABC))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

#x = int(input())
#a = int(input())
#ls = list(input().split(" "))
ls = list(map(int,input().split(" ")))
#a,b = list(map(int,input().split(" ")))
#a,b,c = list(input().split())
#string = input()

k = int(input())

maxnum = max(ls)
ls.remove(maxnum)
print(sum(ls) + maxnum * (2 * k))

Submission status: Wrong Answer

Solution code:

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


def pow(x,k):
    return x * pow(x, k - 1) if k > 0 else 1

print(a+b+pow(c,k))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
k = int(input())
m = max(a, b, c)
ans = 0
ans += a if m != a else 0
ans += b if m != b else 0
ans += c if m != c else 0
m = m * pow(2, k)
ans += m
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
k = int(input())
combi = list(filter(lambda x: sum(x) == k, [(x, y, z) for x in range(0, 11) for y in range(0, 11) for z in range(0, 11)]))
l = lambda p, q: p if q == 0 else p * q * 2
print(max(map(lambda x: l(a, x[0]) + l(b, x[1]) + l(c, x[2]), combi)))

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import time
import re
import math
import fractions

def main():
    x,y,z=map(int,input().split())
    print(max([x,y,z])+sum([x,y,z]))
start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#A=list(map(int,input().split()))
#A,B,C=map(int,input().split())
#n=int(input())

Submission status: Wrong Answer

Solution code:
abc = list(map(int, input().split()))
N = int(input())
ans = 0
for i in range(len(abc)):
  if abc[i] != max(abc):
    ans += abc[i]
  else:
    ans += abc[i]*2**N
print(ans)

Submission status: Wrong Answer

Solution code:
abc = list(map(int, input().split()))
N = int(input())
ans = 0
for i in range(len(abc)):
  if abc[i] != max(abc):
    ans += abc[i]
  else:
    ans += abc[i]*N*2
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(k):
    c.append(max(c))
print(sum(c))

Submission status: Wrong Answer

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

x = max(abc)
total = sum(abc) - x + (x * (2 * k))

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ABC = sorted([A, B, C])

print(A + B + (C * 2 ** K))

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
K=int(input())
ans=0
for i in range(K+1):
    for j in range(K-i):
        ans=max(ans,A*pow(2,i)+B*pow(2,j)+C*pow(2,K-i-j))
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(k):
   n[len(n)-1]*=2
    
print(sum(n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import numpy as np
import math
import re

n = input()
n = re.split(" ",n)
n = list(map(int,n))
m = max(n)
a = int(n[0])
b = int(n[1])
c = int(n[2])
k = int(input())
if(m == a):
    print(b + c + m*2*k)
elif(m == b):
    print(a + c + m*2*k)
elif(m == c):
    print(a + b + m*2*k)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# ABC096B - Maximum Sum
a, b, c = sorted(list(map(int, input().rstrip().split())), reverse=True)
k = int(input())
print(a * 2 * k + b + c)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#094 B
A = [int(j) for j in input().split()]
K=int(input())
A.sort()
print(A[2]*(2*K)+A[0]+A[1])

Submission status: Wrong Answer

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

K = int(input())

A = sorted(A)
a = A.pop(-1)
amax = a * 2 * K

A.append(amax)

print(sum(A))

Submission status: Wrong Answer

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

nums = sorted([A, B, C])
res = 0

for i in range(K):
    if max(nums) + K >= max(nums) * 2:
        res += max(nums) + K
    elif max(nums) + K < max(nums) * 2:
        res += max(nums) * 2

print(res + nums[0] + nums[1])

Submission status: Wrong Answer

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

nums = sorted([A, B, C])
res = 0

for i in range(K):
    if max(nums) + K >= max(nums) * 2:
        res += max(nums) + K
    else:
        res += max(nums) * 2

print(res + nums[0] + nums[1])