ZhenlongDai/ACPR huggingface dataset:
Problem: p03347
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
arr=[int(input()) for _ in range(n)]
l=0
flag=True
for i in range(n):
  if arr[i]==0:
    l=1
  else:
    if arr[i]>l:
      flag=False
      break
    l+=1
if flag==False:
  print(-1)
else:
  ans=arr[-1]
  tmp=arr[-1]
  for i in range(n-2,-1,-1):
    if arr[i]<tmp:
      tmp=arr[i]
    else:
      ans+=arr[i]
      if tmp!=arr[i]:
        tmp=arr[i]
  print(ans)

Failing test case input:
9
0
0
0
-1
-1
2
0
1
-2

Expected output:
-1


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
arr=[int(input()) for _ in range(n)]
l=0
flag=True
for i in range(n):
  if arr[i]==0:
    l=1
  else:
    if arr[i]>l:
      flag=False
      break
    l+=1
  if i!=0:
    if arr[i]-arr[i-1]>=2:
      flag=False
      break
if flag==False:
  print(-1)
else:
  ans=arr[-1]
  tmp=arr[-1]
  for i in range(n-2,-1,-1):
    if arr[i]<tmp:
      tmp=arr[i]
    else:
      ans+=arr[i]
      if tmp!=arr[i]:
        tmp=arr[i]
  print(ans)

Problem: p03347
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
N = int(input())
a = []
for _ in range(N): a.append(int(input()))
if a[0] != 0:
  print(-1)
  exit(0)
for i in range(N - 1):
  if a[i + 1] > a[i] and (a[i + 1] - a[i] > 1):
    print(-1)
    exit(0)
res = 0
s = 0
x = 1
for i in range(1, N):
  if a[i] == x:
    s += 1
  else:
    if x > 0: res += (s - 1) * x + 1
    if x > a[i]:
      res += a[i] - 1
    s = 1
    x = a[i]
  
if x > 0: res += (s - 1) * x + 1
print(res)

Failing test case input:
9
0
1
1
0
1
2
2
1
2

Expected output:
8

Actual output:
7


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
N = int(input())
a = []
for _ in range(N): a.append(int(input()))
if a[0] != 0:
  print(-1)
  exit(0)
for i in range(N - 1):
  if a[i + 1] > a[i] and (a[i + 1] - a[i] > 1):
    print(-1)
    exit(0)
res = 0
s = 0
x = 1
for i in range(1, N):
  if a[i] == x:
    s += 1
  else:
    if x > 0: res += (s - 1) * x + 1
    if x > a[i] and a[i] > 1:
      res += a[i] - 1
    s = 1
    x = a[i]
  
if x > 0: res += (s - 1) * x + 1
print(res)
Problem: p03347
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    if A[0] != 0:
        print(-1)
        exit()
    B = [0] * N
    for i in range(N):
        if 0 <= i - A[i] <= i:
            B[i] = i - A[i]
        else:
            print(-1)
            exit()
    
    pre = max(B)
    cnt = len(B) - 1 - pre
    for i in range(N-1,-1,-1):
        if B[i] != pre:
            cnt += i - B[i]
            pre = B[i]
    print(cnt)

if __name__ == "__main__":
    main()

Failing test case input:
9
0
1
1
0
2
4
2
1
3

Expected output:
-1


Actual output:
16


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    if A[0] != 0:
        print(-1)
        exit()
    cnt = A[-1]

    for i in range(N-2,-1,-1):
        if A[i] >= A[i+1]:
            cnt += A[i]
        elif A[i] == A[i+1] - 1:
            continue
        else:
            print(-1)
            exit()

    print(cnt)

if __name__ == "__main__":
    main()

Problem: p03347
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):


n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))

ans=0
pos=n
pre=0
for i in range(n):
    x=a.pop()
    if x==0:
        continue
    elif x>pos-1:
        ans=-1
        break
    else:
        if x==pre-1:
            pre=x
            continue
        else:
            pre=x
            ans+=x
    pos-=1
print(ans)

Failing test case input:
9
0
0
1
0
2
1
2
3
2

Expected output:
-1


Actual output:
7


Fixed submission (verdict: Accepted):


n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))

ans=0
pos=n
pre=0
b=a[0]
for i in range(n):
    x=a.pop()
    if x==0 and pre<=1:
        continue
    elif x>pos-1:
        ans=-1
        break
    else:
        if x==pre-1:
            pre=x
            continue
        else:
            if x>=pre:
                pre=x
                ans+=x
            else:
                ans=-1
                break
    pos-=1
if b>0:
    ans=-1
print(ans)
Problem: p03347
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = [inp() for _ in range(n)]
res = 0
for i in range(1,n)[::-1]:
    if a[i]-a[i-1] == 1:
        res += 1
    else:
        res += a[i]
if a[0] != 0:
    res = -1 
print(res)

Failing test case input:
9
0
-1
-1
-1
-1
2
1
1
-2

Expected output:
-1


Actual output:
-2


Fixed submission (verdict: Accepted):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = [inp() for _ in range(n)]
res = 0
for i in range(1,n)[::-1]:
    if a[i]-a[i-1] == 1:
        res += 1
    else:
        res += a[i]
for i in range(n-1):
    if a[i+1] - a[i] > 1:
        res = -1
if a[0] != 0:
    res = -1 
print(res)

Problem: p03347
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
A = [int(input()) for i in range(n)]

if A[0] != 0:
    print(-1)
    exit()

ans = 0
for i in range(1, n):
    if A[i] == 0:
        continue
    elif A[i] == 1:
        ans += 1
    else:
        if A[i-1]+1 == A[i]:
            ans += 1
        else:
            ans += 2
print(ans)

Failing test case input:
9
0
1
1
-1
2
1
2
3
-1

Expected output:
-1


Actual output:
11


Fixed submission (verdict: Accepted):
n = int(input())
A = [int(input()) for i in range(n)]

if A[0] != 0:
    print(-1)
    exit()

for i in range(1, n):
    if A[i] > A[i-1]+1:
        print(-1)
        exit()

ans = 0
for i in reversed(range(1, n)):
    if A[i-1] == A[i]-1:
        ans += 1
    else:
        ans += A[i]

print(ans)
Problem: p03347
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = []
ans = 0
for _ in range(n):
    a.append(int(input()))
if a[0] != 0:
    ans = -1
else:
    for i in range(n - 1):
        if (a[i+1] - a[i]) > 1:
            ans = -1
            break
        else:
            if a[i+1] == a[i]:
                if a[i+1] > 0:
                    ans += a[i+1] - 1
            if a[i+1] > 0:
                ans += 1
            if a[i+1] < a[i]:
                ans += a[i+1] - 1
            
print(ans)

Failing test case input:
9
0
1
1
0
1
2
2
1
2

Expected output:
8

Actual output:
7


Fixed submission (verdict: Accepted):
n = int(input())
a = []
ans = 0
for _ in range(n):
    a.append(int(input()))
if a[0] != 0:
    ans = -1
else:
    for i in range(n - 1):
        if (a[i+1] - a[i]) > 1:
            ans = -1
            break
        else:
            if a[i+1] == a[i]:
                if a[i+1] > 0:
                    ans += a[i+1] - 1
            if a[i+1] > 0:
                ans += 1
            if a[i+1] < a[i]:
                if a[i+1] > 1:
                    ans += a[i+1] - 1
            
print(ans)

Problem: p03347
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
arr=[int(input()) for _ in range(n)]
l=0
flag=True
for i in range(n):
  if arr[i]==0:
    l=0
  else:
    if arr[i]>l:
      flag-False
      break
    l+=1
if flag==False:
  print(-1)
else:
  ans=arr[-1]
  tmp=arr[-1]
  for i in range(n-2,-1,-1):
    if arr[i]==tmp:
      ans+=arr[i]
    else:
      tmp=arr[i]
  print(ans)

Failing test case input:
9
-1
0
1
0
2
1
2
2
3

Expected output:
-1


Actual output:
5


Fixed submission (verdict: Accepted):
n=int(input())
arr=[int(input()) for _ in range(n)]
l=0
flag=True
for i in range(n):
  if arr[i]==0:
    l=1
  else:
    if arr[i]>l:
      flag=False
      break
    l+=1
  if i!=0:
    if arr[i]-arr[i-1]>=2:
      flag=False
      break
if flag==False:
  print(-1)
else:
  ans=arr[-1]
  tmp=arr[-1]
  for i in range(n-2,-1,-1):
    if arr[i]<tmp:
      tmp=arr[i]
    else:
      ans+=arr[i]
      if tmp!=arr[i]:
        tmp=arr[i]
  print(ans)

Problem: p03347
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
src = [int(input()) for i in range(N)]
if src[0]:
    print(-1)
    exit()

ans = prev = 0
for a in reversed(src):
    if prev > 0:
        if a == prev - 1:
            prev = a
            continue
    ans += a
    prev = a
print(ans)        


Failing test case input:
9
0
1
1
0
2
2
2
1
4

Expected output:
-1


Actual output:
13


Fixed submission (verdict: Accepted):
N = int(input())
src = [int(input()) for i in range(N)]
if src[0]:
    print(-1)
    exit()

ans = prev = 0
for a in reversed(src):
    if prev > 0:
        if a == prev - 1:
            prev = a
            continue
        elif a < prev:
            print(-1)
            exit()
    ans += a
    prev = a
print(ans)
Problem: p03347
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())
A = [int(input()) for _ in range(N)]
    
if A[0] != 0:
    print(-1)

else:
    roop = 0
    for i in range(1,N):
        num = A[i]
        if num >= A[i-1]+1:
            roop += num - A[i-1]
        else:
            roop += num
    print(roop)
            

Failing test case input:
9
0
1
1
-1
2
1
2
3
0

Expected output:
-1


Actual output:
7


Fixed submission (verdict: Accepted):

N = int(input())
A = [int(input()) for _ in range(N)]
    
if A[0] != 0:
    print(-1)

else:
    roop = 0
    for i in range(1,N):
        num = A[i]
        if num == A[i-1]+1:
            roop += 1
        elif num <= A[i-1]:
            roop += num
        else:
            roop = -1
            break
    print(roop)

Problem: p03347
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(input()) for _ in range(N)]
    
if A[0] != 0:
    print(-1)

else:
    roop = 0
    for i in range(1,N):
        num = A[i]
        if num == A[i-1]+1:
            roop += 1
        elif num == A[i-1]:
            roop += num
        elif num == 0:
            continue
        else:
            roop = -1
            break
    print(roop)
            

Failing test case input:
9
0
1
1
0
1
2
2
1
2

Expected output:
8

Actual output:
-1


Fixed submission (verdict: Accepted):

N = int(input())
A = [int(input()) for _ in range(N)]
    
if A[0] != 0:
    print(-1)

else:
    roop = 0
    for i in range(1,N):
        num = A[i]
        if num == A[i-1]+1:
            roop += 1
        elif num <= A[i-1]:
            roop += num
        else:
            roop = -1
            break
    print(roop)

Problem: p03347
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
A = [int(input()) for _ in range(N)]

def solve() :
  now = 0
  for i in range(N) :
    if A[i] > now :
      return -1
    if A[i] == 0 :
      now = 1
    else :
      now += 1

  ret = 0
  for i in range(1, N) :
    if A[i] == 0 :
      continue
    
    ret += 1
    if A[i] != A[i-1] + 1 :
      ret += A[i] * (A[i] - 1) 
  
  return ret

print(solve())

Failing test case input:
9
0
1
1
-1
2
1
2
3
0

Expected output:
-1


Actual output:
11


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(input()) for _ in range(N)]

def solve() :
  if A[0] != 0 :
    return -1

  for i in range(1, N) :
    if A[i] - A[i-1] >= 2:
      return -1

  ret = 0
  for i in range(1, N) :
    if A[i] == 0 :
      continue

    ret += 1
    if A[i] != A[i-1] + 1 :
      ret += A[i] - 1
  
  return ret

print(solve())
Problem: p02782
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
r1,c1,r2,c2 = map(int,input().split())
mod = 10**9+7

def p_mod(m,n,p):
    a = 1
    for i in range(n):
        a = a*(m-i) % p
    return a

def c_mod(m,n,p):
    return (p_mod(m,n,p)*pow(p_mod(n,n,p),p-2,p)) % p

print(c_mod(r2+c2+2,r2+1,mod) - c_mod(r1+c2+1,r1,mod) - c_mod(r2+c1+1,c1,mod) + c_mod(r1+c1,r1,mod))

Failing test case input:
268 3 533 30

Expected output:
753749883


Actual output:
-246250124


Fixed submission (verdict: Accepted):
r1,c1,r2,c2 = map(int,input().split())
mod = 10**9+7

def p_mod(m,n,p):
    a = 1
    for i in range(n):
        a = a*(m-i) % p
    return a

def c_mod(m,n,p):
    return (p_mod(m,n,p)*pow(p_mod(n,n,p),p-2,p)) % p

print((c_mod(r2+c2+2,r2+1,mod) - c_mod(r1+c2+1,r1,mod) - c_mod(r2+c1+1,c1,mod) + c_mod(r1+c1,r1,mod)) % mod)

Problem: p02782
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
r1,c1,r2,c2=map(int,input().split())
mod=10**9+7
def comb(n,k,mod):
  if n<k:
    return 0
  if n-k<k:
    k=n-k
  c=1
  for x in range(n-k+1,n+1):
    c=(c*x)%mod
  d=1
  for x in range(1,k+1):
    d=(d*x)%mod
  c=c*pow(d,mod-2,mod)
  return c%mod
def f(i,j):
  return comb(i+j,i,mod)
ans=f(r2+1,c2+1)-f(r2+1,c1)-f(r1,c2+1)+f(r1,r2)
ans%=mod
print(ans)


Failing test case input:
252 5 2691 30

Expected output:
563695445


Actual output:
57711238


Fixed submission (verdict: Accepted):
r1,c1,r2,c2=map(int,input().split())
mod=10**9+7
def comb(n,k,mod):
  if n<k:
    return 0
  if n-k<k:
    k=n-k
  c=1
  for x in range(n-k+1,n+1):
    c=(c*x)%mod
  d=1
  for x in range(1,k+1):
    d=(d*x)%mod
  c=c*pow(d,mod-2,mod)
  return c%mod
def f(i,j):
  return comb(i+j,i,mod)
ans=f(r2+1,c2+1)-f(r2+1,c1)-f(r1,c2+1)+f(r1,c1)
ans%=mod
print(ans)

Problem: p02782
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
bikkuri = [1]
mod = 10**9+7

for i in range(1,2*10**6+1000):
    bikkuri.append((bikkuri[-1]*i)%mod)
r1,c1,r2,c2 = map(int,input().split())

def F(r,c):
    tmp = (bikkuri[r+c+2]*pow(bikkuri[c+1],mod-2,mod)*pow(bikkuri[r+1],mod-2,mod) - 1)%mod
    return tmp

ans = F(r2,c2)-F(r1-1,c2)-F(r2,c1-1)+F(r1-1,c1-1)
print(ans)

Failing test case input:
129 5 2691 348

Expected output:
896136586


Actual output:
-1103863428


Fixed submission (verdict: Accepted):
bikkuri = [1]
mod = 10**9+7

for i in range(1,2*10**6+1000):
    bikkuri.append((bikkuri[-1]*i)%mod)
r1,c1,r2,c2 = map(int,input().split())

def F(r,c):
    tmp = (bikkuri[r+c+2]*pow(bikkuri[c+1],mod-2,mod)*pow(bikkuri[r+1],mod-2,mod) - 1)%mod
    return tmp

ans = (F(r2,c2)-F(r1-1,c2)-F(r2,c1-1)+F(r1-1,c1-1))%mod
print(ans)
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
k = int(input())
if max(a,b,c) == a:
  print(a**(k+1)+b+c)
elif max(a,b,c) == b:
  print(b**(k+1)+a+c)
else:
  print(a+b+c**(k+1))

Failing test case input:
3 2 4
4

Expected output:
69


Actual output:
1029


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
k = int(input())
if max(a,b,c) == a:
  print(a*(2**k)+b+c)
elif max(a,b,c) == b:
  print(b*(2**k)+a+c)
else:
  print(a+b+c*(2**k))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int,input().split()))
b = int(input())
print(sum(a)+max(a)*2*b-max(a))

Failing test case input:
6 3 41
0

Expected output:
50


Actual output:
9


Fixed submission (verdict: Accepted):
a = list(map(int,input().split()))
b = int(input())
print(sum(a)+max(a)*(2**b)-max(a))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

Failing test case input:
5 2 -1
4

Expected output:
81


Actual output:
41


Fixed submission (verdict: Accepted):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l=list(map(int,input().split()))
k=int(input())
m=max(l)
a=k*2*m
for i in range(len(l)):
    if l[i]==m:
        l[i]=a
print(sum(l))

Failing test case input:
7 6 11
0

Expected output:
24


Actual output:
13


Fixed submission (verdict: Accepted):
l=list(map(int,input().split()))
k=int(input())
m=max(l)
a=2**k*m
for i in range(len(l)):
    if l[i]==m:
        l[i]=a
        break

print(sum(l))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
abc = list(map(int,input().split()))
k = int(input())
print( sum(abc)-max(abc) + (max(abc)*2*k) )


Failing test case input:
5 2 1
4

Expected output:
83


Actual output:
43


Fixed submission (verdict: Accepted):
abc = list(map(int,input().split()))
k = int(input())
print( sum(abc)-max(abc) + (max(abc)*2**k) )

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
k=int(input())

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

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

Failing test case input:
8 5 25
0

Expected output:
38


Actual output:
13


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
k=int(input())

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

print(kazu[0]+kazu[1]+kazu[2]*2**k)
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def resolve():
    A, B, C = map(int, input().split())
    K = int(input())
    for i in range(K):
        C *= 2
    print(A+B+C)
resolve()

Failing test case input:
5 2 0
4

Expected output:
82


Actual output:
7


Fixed submission (verdict: Accepted):
def resolve():
    a = list(map(int, input().split()))
    K = int(input())
    print(sum(a)-max(a)+max(a)*(2**K))
resolve()

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c+max(a,b,c)*k)

Failing test case input:
3 2 4
2

Expected output:
21


Actual output:
17


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c+max(a,b,c)*(2**k-1))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
K = int(input())
print(max(A, B, C)*2*K + A + B + C - max(A, B, C))


Failing test case input:
7 7 23
0

Expected output:
37


Actual output:
14


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
K = int(input())
print(max(A, B, C)*(2**K) + A + B + C - max(A, B, C))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C = map(int, input().split())
K = int(input())

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


Failing test case input:
5 4 1
5

Expected output:
165


Actual output:
55


Fixed submission (verdict: Accepted):
A,B,C = map(int, input().split())
K = int(input())

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split())
k = int(input())

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


Failing test case input:
5 3 4
4

Expected output:
87


Actual output:
47


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
k = int(input())

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c+max(a,b,c)*(2**(k-1)))

Failing test case input:
15 0 1
0

Expected output:
16


Actual output:
23.5


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c+max(a,b,c)*(2**(k))-max(a,b,c))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
*a,=map(int,input().split());m=max(a);print(sum(a)+m*2*int(input())-m)

Failing test case input:
7 7 21
0

Expected output:
35


Actual output:
14


Fixed submission (verdict: Accepted):
*a,=map(int,input().split());m=max(a);print(sum(a)+m*2**int(input())-m)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
k = int(input())
x = max(a,b,c)
print(a+b+c+x*2*k-x)

Failing test case input:
5 2 -1
4

Expected output:
81


Actual output:
41


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
k = int(input())
x = max(a,b,c)
print(a+b+c+x*2**k-x)
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
k=int(input())
m=max(a,b,c)
print(m*2*k+a+b+c-m)

Failing test case input:
15 1 1
3

Expected output:
122


Actual output:
92


Fixed submission (verdict: Accepted):
a,b,c=map(int,input().split())
k=int(input())
print(max(a,b,c)*2**k+a+b+c-max(a,b,c))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L=list(map(int,input().split()))
K=int(input())
m=max(L)
print(sum(L)-m+m*2*K)

Failing test case input:
6 3 21
0

Expected output:
30


Actual output:
9


Fixed submission (verdict: Accepted):
L=list(map(int,input().split()))
K=int(input())
m=max(L)
print(sum(L)-m+m*2**K)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

if __name__ == "__main__":
    A, B, C = list(map(int, input().split()))
    K = int(input())
    l = [A, B, C]
    l.sort()
    ans = l[2] * 2 * K + l[0] + l[1]
    print(ans)


Failing test case input:
-1 0 -1
-1

Expected output:
-2.0


Actual output:
-2


Fixed submission (verdict: Accepted):

if __name__ == "__main__":
    A, B, C = list(map(int, input().split()))
    K = int(input())
    l = [A, B, C]
    l.sort()
    ans = l[2] * (2**K) + l[0] + l[1]
    print(ans)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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]))


Failing test case input:
7 1 3
4

Expected output:
116


Actual output:
60


Fixed submission (verdict: Accepted):
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]))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
42 4 6
4

Expected output:
682


Actual output:
346


Fixed submission (verdict: Accepted):
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)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ds = list(map(int, input().split()))
k = int(input())
sorted(ds)
print(sum(ds[:-1]) + ds[-1]*(2**k))

Failing test case input:
5 4 1
5

Expected output:
165


Actual output:
41


Fixed submission (verdict: Accepted):
ds = list(map(int, input().split()))
k = int(input())
ds = sorted(ds)
print(ds[0] + ds[1] + ds[2]*(2**k))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=list(map(int,input().split()))
K=int(input())
NN = sorted(N, reverse=True)
print(sum(NN[0:K]) * 2 + sum(NN[K:])) 


Failing test case input:
42 4 8
4

Expected output:
684


Actual output:
108


Fixed submission (verdict: Accepted):
N=list(map(int,input().split()))
K=int(input())
NN = sorted(N, reverse=True)

print(NN[0] * 2 ** K + sum(NN[1:]))
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num=list(map(int,input().split()))
k=int(input())
ans1=sum(num)-max(num)
ans2=0

while k>0:
  ans2+=max(num)*2
  k-=1
  
print(ans1+ans2)

Failing test case input:
10 5 24
0

Expected output:
39


Actual output:
15


Fixed submission (verdict: Accepted):
num=list(map(int,input().split()))
k=int(input())
ans1=sum(num)-max(num)
print(2**k*max(num)+ans1)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
K = int(input())
m = max(A, B, C)
print(A + B + C + m * (2 * K - 1))


Failing test case input:
5 3 4
4

Expected output:
87


Actual output:
47


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
K = int(input())
m = max(A, B, C)
print(A + B + C + m * (2 ** K - 1))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)*(2**(k+1))-(a+b+c)
print(ans)


Failing test case input:
10 5 24
1

Expected output:
63


Actual output:
57


Fixed submission (verdict: Accepted):
a,b,c = map(int,input().split())
k = int(input())
ans = max(a,b,c)*(2**k-1)+(a+b+c)
print(ans)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = list(map(int,input().split()))
D = int(input())
M = max(A)
K = (D*2*M) + (sum(A) - max(A))
print(K)

Failing test case input:
7 7 11
0

Expected output:
25


Actual output:
14


Fixed submission (verdict: Accepted):
A = list(map(int,input().split()))
D = int(input())
M = max(A)
K = (2**D*M) + (sum(A) - max(A))
print(K)

Problem: p03360
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


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

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

Failing test case input:
3 2 4
4

Expected output:
69


Actual output:
37


Fixed submission (verdict: Accepted):


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

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main() -> None:
    A, B, C = map(int, input().split())
    K = int(input())
    m = [A, B, C]
    m.sort(reverse=True)
    ans = m[0] * 2 * K
    ans += sum(m[1:])
    print(ans)


if __name__ == '__main__':
    main()

Failing test case input:
5 4 1
5

Expected output:
165


Actual output:
55


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


if __name__ == '__main__':
    main()

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A=sorted(list(map(int,input().split())))
K=int(input())
print(A[2]*2*K+sum(A[:2]))

Failing test case input:
7 7 11
0

Expected output:
25


Actual output:
14


Fixed submission (verdict: Accepted):
A=sorted(list(map(int,input().split())))
K=int(input())
print(A[2]*2**K+sum(A[:2]))
Problem: p03360
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b, c = map(int, input().split())
k = int(input())
list = [a, b, c]
max = max(list)
if a == max:
    print(b+c+a*2*k)
elif b == max:
    print(a+c+b*2*k)
else:
    print(a+b+c*2*k)

Failing test case input:
7 5 11
0

Expected output:
23


Actual output:
12


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
k = int(input())
list = [a, b, c]
max = max(list)
if a == max:
    print(b+c+a*2**k)
elif b == max:
    print(a+c+b*2**k)
else:
    print(a+b+c*2**k)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nums = list(map(int, input().split()))
K = int(input())
print(sum(nums) + max(nums)*(2**(K-1)))


Failing test case input:
6 5 56
0

Expected output:
67


Actual output:
95.0


Fixed submission (verdict: Accepted):
nums = list(map(int, input().split()))
K = int(input())
print(sum(nums) + max(nums)*(2**K) - max(nums))

Problem: p03360
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def answer(a: int, b: int, c: int, k: int) -> int:
    nums = sorted((a, b, c))
    nums[-1] = nums[-1] * 2 * k

    return sum(nums)


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


if __name__ == '__main__':
    main()


Failing test case input:
7 3 2
4

Expected output:
117


Actual output:
61


Fixed submission (verdict: Accepted):
def answer(a: int, b: int, c: int, k: int) -> int:
    nums = sorted((a, b, c))
    nums[-1] = nums[-1] * 2 ** k

    return sum(nums)


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


if __name__ == '__main__':
    main()

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = list(map(int, input().split()))
k = int(input())

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

Failing test case input:
0 8 3
4

Expected output:
131


Actual output:
67


Fixed submission (verdict: Accepted):
a, b, c = list(map(int, input().split()))
k = int(input())

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
list = list(map(int, input().split()))
k = int(input())

print(max(list)*(2*k))


Failing test case input:
3 1 1
0

Expected output:
5


Actual output:
0


Fixed submission (verdict: Accepted):
list = list(map(int, input().split()))
k = int(input())

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

Problem: p03360
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b, c = map(int, input().split())
k = int(input())
x = max(a, b, c)
if x == a:
    print(a*2*k + b + c)
elif x == b:
    print(a + b*2*k + c)
else:
    print(a + b + c*2*k)

Failing test case input:
15 0 1
3

Expected output:
121


Actual output:
91


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
k = int(input())
x = max(a, b, c)
if x == a:
    print(a*2**k + b + c)
elif x == b:
    print(a + b*2**k + c)
else:
    print(a + b + c*2**k)
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = map(int, input().split())		
k = int(input())

x = max(a,b,c)

y = x * (2**k)

if x==a: print(y+b+c)
if x==b: print(a+y+c)
if x==c: print(a+b+y)

	

Failing test case input:
-1 0 0
-1

Expected output:
-1.0


Actual output:
-1.0
-1.0


Fixed submission (verdict: Accepted):
a,b,c = map(int, input().split())		
k = int(input())

x = max(a,b,c)

y = x * (2**k)

if x==a:
	print(y+b+c)
	exit(0)
if x==b:
	print(a+y+c)
	exit(0)
if x==c:
	print(a+b+y)
	exit(0)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=map(int,input().split())
k = int(input())
max_num = max(max(a, b), c)
print(a+b+c+max(max(a, b), c)*k-k)

Failing test case input:
13 5 21
1

Expected output:
60


Actual output:
59


Fixed submission (verdict: Accepted):
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)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=sorted(map(int,input().split()))
print(a[0]+a[1]+a[2]*(2*int(input())))

Failing test case input:
11 0 1
0

Expected output:
12


Actual output:
1


Fixed submission (verdict: Accepted):
a=sorted(map(int,input().split()))
print(sum(a)+max(a)*(2**int(input())-1))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
numbers = list(map(int, input().split()))
K = int(input())
max_index = numbers.index(max(numbers))
result = 0
print('max: ', numbers[max_index])
result = [numbers[i] * 2 ** K if i == max_index else numbers[i] for i in range(len(numbers))]
print(sum(result))

Failing test case input:
11 0 1
0

Expected output:
12


Actual output:
max:  11
12


Fixed submission (verdict: Accepted):
numbers = [int(i) for i in input().split()] 
K = list(map(int, input().split()))[0]
max_index = numbers.index(max(numbers))
result = [numbers[i] * 2 ** K if i == max_index else numbers[i] for i in range(len(numbers))]
print(sum(result))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = list(map(int, input().split()))
K = int(input())

print((sum(A) - max(A)) + max(A) * 2 * K)

Failing test case input:
5 4 11
4

Expected output:
185


Actual output:
97


Fixed submission (verdict: Accepted):
A = list(map(int, input().split()))
K = int(input())

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ABC = list(map(int, input().split()))
K = int(input())
print(max(ABC) * K + (sum(ABC) - max(ABC)))



Failing test case input:
5 3 11
1

Expected output:
30

Actual output:
19


Fixed submission (verdict: Accepted):
ABC = list(map(int, input().split()))
K = int(input())
print(max(ABC) * 2**K + (sum(ABC) - max(ABC)))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B,C=map(int,input().split())
K=int(input())
m=max(A,B,C)
print(A+B+C+m*2*K)

Failing test case input:
11 0 0
1

Expected output:
22


Actual output:
33


Fixed submission (verdict: Accepted):
L=list(map(int,input().split()))
K=int(input())
m=max(L)
print(sum(L)-m+m*2**K)
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
K = int(input())
max_num = max(A, B, C)*2*K
others = A + B + C - max(A, B, C)
print(others + max_num)


Failing test case input:
8 5 25
0

Expected output:
38


Actual output:
13


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
K = int(input())
max_num = max(A, B, C)*2**K
others = A + B + C - max(A, B, C)
print(others + max_num)

Problem: p03360
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

A,B,C = I()
K = i()
m = max(A,B,C)
ans = A+B+C+m*(2*K-1)
print(ans)

Failing test case input:
6 3 41
0

Expected output:
50


Actual output:
9


Fixed submission (verdict: Accepted):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

A,B,C = I()
K = i()
m = max(A,B,C)
ans = A+B+C+m*(2**K-1)
print(ans)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = sorted(map(int, input().split()))
k = int(input())
l[2] = l[2] * k ** 2
print(sum(l))


Failing test case input:
4 0 41
1

Expected output:
86


Actual output:
45


Fixed submission (verdict: Accepted):
l = sorted(map(int, input().split()))
k = int(input())
l[2] = l[2] * (2 ** k)
print(sum(l))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = list(map(int,input().split( )))
y = int(input())
xx = sorted(x)
xx[2] == xx[2]*2**y
ans = sum(xx)
print(ans)

Failing test case input:
3 2 4
2

Expected output:
21


Actual output:
9


Fixed submission (verdict: Accepted):
x = list(map(int,input().split( )))
y = int(input())
xx = sorted(x)
xx[2] *= 2**y
ans = sum(xx)
print(ans)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
*ABC, = map(int, input().split())
K = int(input())
print(sum(ABC) - max(ABC) + (max(ABC) * 2 * K))

Failing test case input:
-2 4 1
7

Expected output:
511


Actual output:
55


Fixed submission (verdict: Accepted):
*ABC, = map(int, input().split())
K = int(input())
print(sum(ABC) - max(ABC) + (max(ABC) * 2 ** K))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().rstrip().split())
K = int(input())
print(2*K*max(A,B,C)+A+B)

Failing test case input:
15 0 1
3

Expected output:
121


Actual output:
105


Fixed submission (verdict: Accepted):
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))
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
abc = list(map(int, input().split()))
k = int(input())

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

Failing test case input:
10 5 25
0

Expected output:
40


Actual output:
15


Fixed submission (verdict: Accepted):
abc = list(map(int, input().split()))
k = int(input())

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = sorted(map(int, input().split()), reverse=True)
k = int(input())
print(b+c+a*2*k)


Failing test case input:
0 8 3
4

Expected output:
131


Actual output:
67


Fixed submission (verdict: Accepted):
a, b, c = sorted(map(int, input().split()), reverse=True)
k = int(input())
print(b+c+a*2**k)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ABC=list(map(int,input().split()))
K=int(input())
ABC.sort()
print(ABC[0]+ABC[1]+ABC[2]*2*K)


Failing test case input:
42 4 6
4

Expected output:
682


Actual output:
346


Fixed submission (verdict: Accepted):
ABC=list(map(int,input().split()))
K=int(input())
ABC.sort()
ABC[2]*=2**K
print(sum(ABC))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
K = int(input())

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

Failing test case input:
11 0 1
0

Expected output:
12


Actual output:
1


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
K = int(input())

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

Failing test case input:
5 3 21
0

Expected output:
29


Actual output:
8


Fixed submission (verdict: Accepted):

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c = input().split()
a = int(a)
b = int(b)
c = int(c)
L = []
L.append(a)
L.append(b)
L.append(c)
L.sort(reverse=True)
K = int(input())
ans = L[0]*2*K + L[1] + L[2]
print(ans)


Failing test case input:
4 3 1
0

Expected output:
8


Actual output:
4


Fixed submission (verdict: Accepted):
a,b,c = input().split()
a = int(a)
b = int(b)
c = int(c)
L = []
L.append(a)
L.append(b)
L.append(c)
L.sort(reverse=True)
K = int(input())
ans = L[0]*2**K + L[1] + L[2]
print(ans)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
3 4 8
0

Expected output:
15


Actual output:
7


Fixed submission (verdict: Accepted):
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)
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = [int(i) for i in input().split()]
k = int(input())
a.sort()
print(a[len(a)-1]**8+sum(a)-a[len(a)-1])

Failing test case input:
5 3 11
1

Expected output:
30

Actual output:
214358889


Fixed submission (verdict: Accepted):
a = [int(i) for i in input().split()]
k = int(input())
a.sort()
print(a[len(a)-1]*2**k+sum(a)-a[len(a)-1])

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b, c = map(int, input().split(" "))
n = int(input())
result = 0

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

print(result)

Failing test case input:
5 4 2
5

Expected output:
166


Actual output:
56


Fixed submission (verdict: Accepted):

a, b, c = map(int, input().split(" "))
n = int(input())
result = 0

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

print(result)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
L = list(map(int, input().split()))
K = int(input())

L.sort()
print(L)

print(sum(L) + L[len(L) - 1] * (2 ** K - 1))

Failing test case input:
12 10 25
0

Expected output:
47


Actual output:
[10, 12, 25]
47


Fixed submission (verdict: Accepted):
L = list(map(int, input().split()))
K = int(input())

L.sort()

print(sum(L) + L[len(L) - 1] * (2 ** K - 1))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=list(map(int,input().split()))
k=int(input())
print(max(x)*k+sum(x)-max(x))

Failing test case input:
0 0 1
0

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
x=list(map(int,input().split()))
k=int(input())
print(max(x)*(2**k)+sum(x)-max(x))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
K = int(input())
mx = max(A, B, C)

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


Failing test case input:
4 3 4
0

Expected output:
11


Actual output:
7


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
K = int(input())
mx = max(A, B, C)

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int, input().split()))
k = int(input())
print(a.pop()*(2**k) + sum(a))

Failing test case input:
3 8 3
4

Expected output:
134


Actual output:
59


Fixed submission (verdict: Accepted):
a = list(map(int, input().split()))
k = int(input())
a.sort()
print(a.pop()*(2**k) + sum(a))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

Failing test case input:
5 2 1
4

Expected output:
83


Actual output:
43


Fixed submission (verdict: Accepted):

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))
Problem: p03360
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b, c = map(int, input().split())
k = int(input())
list = [a, b, c]
max = max(list)
if a == max:
    print(b+c+(a*2*k))
elif b == max:
    print(a+c+(b*2*k))
else:
    print(a+b+(c*2*k))

Failing test case input:
3 1 1
0

Expected output:
5


Actual output:
2


Fixed submission (verdict: Accepted):
a, b, c = map(int, input().split())
k = int(input())
list = [a, b, c]
max = max(list)
if a == max:
    print(b+c+a*2**k)
elif b == max:
    print(a+c+b*2**k)
else:
    print(a+b+c*2**k)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=sorted(map(int,input().split()))
print(a[0]+a[1]+a[2]*2*int(input()))

Failing test case input:
42 4 6
5

Expected output:
1354


Actual output:
430


Fixed submission (verdict: Accepted):
a=sorted(map(int,input().split()))
print(sum(a)+max(a)*(2**int(input())-1))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


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

Failing test case input:
42 6 6
5

Expected output:
1356


Actual output:

Fixed submission (verdict: Accepted):
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)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = list(map(int, input().split()))
k = int(input())
A.sort()
A[2] = A[2]*2*k
print(sum(A))

Failing test case input:
-1 0 -1
-1

Expected output:
-2.0


Actual output:
-2


Fixed submission (verdict: Accepted):
A = list(map(int, input().split()))
k = int(input())
A.sort()
A[2] = A[2]*2**k
print(sum(A))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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)


Failing test case input:
8 5 25
0

Expected output:
38


Actual output:
13


Fixed submission (verdict: Accepted):

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)

Problem: p03360
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a=list(map(int,input().split()))
a.sort()
print(a[0]+a[1]+a[2]*2)

Failing test case input:
4 3 4
0

Expected output:
11


Actual output:
15


Fixed submission (verdict: Accepted):
a=list(map(int,input().split()))
b=int(input())
a.sort()
print(a[0]+a[1]+(a[2]*(2**b)))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
l = list(map(int, input().split()))
K = int(input())
print(sum(l)+(max(l))*(K-1))


Failing test case input:
5 3 21
0

Expected output:
29


Actual output:
8


Fixed submission (verdict: Accepted):


import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
l = list(map(int, input().split()))
K = int(input())
ans = sum(l)-max(l)
ans += max(l)*(2**K)
print(ans)
Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B, C = map(int, input().split())
K = int(input())

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

Failing test case input:
4 2 1
0

Expected output:
7


Actual output:
3


Fixed submission (verdict: Accepted):
A, B, C = map(int, input().split())
K = int(input())

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A=  sorted(list(map(int, input().split())))
n = int(input())
print(sum(A[:-1]) + A[-1] *2*n )



Failing test case input:
3 2 4
4

Expected output:
69


Actual output:
37


Fixed submission (verdict: Accepted):
A=  sorted(list(map(int, input().split())))
n = int(input())

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

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
lst = list(map(int, input().split()))
K = int(input())
lst.sort()
lst[-1] = lst[-1]*2*K
print(sum(lst))

Failing test case input:
7 5 11
0

Expected output:
23


Actual output:
12


Fixed submission (verdict: Accepted):
lst = list(map(int, input().split()))
K = int(input())
lst.sort()
lst[-1] = lst[-1]*(2**K)
print(sum(lst))

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x,y,z=[int(x) for x in str(input()).split()]
k=int(input())

a=max(x,y,z)
print(x+y+z+a+(k-1)*2*a)

Failing test case input:
3 1 1
0

Expected output:
5


Actual output:
2


Fixed submission (verdict: Accepted):
x,y,z=[int(x) for x in str(input()).split()]
k=int(input())

a=max(x,y,z)
print(x+y+z-a+2**k*a)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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







Failing test case input:
5 3 11
4

Expected output:
184


Actual output:
30


Fixed submission (verdict: Accepted):

import time
import re
import math
import fractions

def main():
    A=list(map(int,input().split()))
    K=int(input())
    A.sort(key=lambda x:-x)
    print(sum(A)-A[0]+A[0]*(2**K))
start=time.time()
main()

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nums = list(map(int,input().split()))
k = int(input())
print(sum(nums) - max(nums) + max(nums)*2*k)

Failing test case input:
10 5 25
0

Expected output:
40


Actual output:
15


Fixed submission (verdict: Accepted):
nums = list(map(int,input().split()))
k = int(input())
print(sum(nums) - max(nums) + max(nums)*2**k)

Problem: p03360
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
e = [int(i) for i in input().split()]
k = int(input())

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


Failing test case input:
17 5 21
0

Expected output:
43


Actual output:
53.5


Fixed submission (verdict: Accepted):
e = [int(i) for i in input().split()]
k = int(input())

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