Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N,A,B = map(int,input().split())
H = [int(input()) for _ in range(N)]

from math import ceil

ng,ok = 0,10**9+1
while ok!=ng:
    mid = (ng+ok)//2
    cnt = 0
    for i in range(N):
        cnt += max(ceil((H[i] - B*mid)/(A-B)) ,0)
    if cnt <= mid:
        ok = mid
    else:
        ng = mid

print(ok)


Fixed submission:
#####################################
N,A,B = map(int,input().split())
H = [int(input()) for _ in range(N)]

from math import ceil

ng,ok = 0,10**9+1
while abs(ok-ng)>1:
    mid = (ng+ok)//2
    cnt = 0
    for i in range(N):
        cnt += max(ceil((H[i] - B*mid)/(A-B)) ,0)
    if cnt <= mid:
        ok = mid
    else:
        ng = mid

print(ok)
Buggy python submission (verdict: Runtime Error):
a , b = map(int,input().split())
print("#"*(3+2))
for i in range(1,b):
    tmp = input()
    print("#"+tmp+"#")
print("#"*(3+2))

Fixed submission:
h,w = map(int,input().split())
s = []
for i in range(h):
    s.append("#"+input()+"#")
print("#"*(w+2))
for i in s:
    print(i)
print("#"*(w+2))
Buggy python submission (verdict: Runtime Error):
a , b = map(int,input().split())
k = []
for i in range(b):
    t,n = map(int,input().split())
    k.append(t)
    k.append(n)
    
import collections

v = collections.Counter(k)
for i in range(a):
    print (v.most_common()[i][1])

Fixed submission:
a , b = map(int,input().split())
k = []
for i in range(b):
    t,n = map(int,input().split())
    k.append(t)
    k.append(n)
    
import collections

v = collections.Counter(k)
for i in range(a):
    print (v[i+1])
Buggy python submission (verdict: Runtime Error):
a = input()
b = int(a)

s = (9-len(a))*'0'+a
ans = 0
for i in range(9):
    if s[i] == '0' and ans==0:
        continue
    ans+=(b//((10**(8-i))*10))*(10**(8-i))
    c = (b%((10**(8-i))*10))+1
    #print(0,c)
    if 2*(10**(8-i))>= c > 10**(8-i):
        ans+=c-10**(8-i)
    elif c>=2*10**((8-i)):
        ans+=10**(8-i)
    #print(ans)
print(ans)


Fixed submission:
def lma():return list(map(int, input().split()))#x or y
a = lma()
f = 1
c =0
while f:
    if a[0]%2==1 or a[1]%2==1 or a[2]%2 ==1:break
    if (a[0] == a[1] and a[0] == a[2]) :
        c=-1
        break
    a[0],a[1],a[2] = (a[1]+a[2])/2,(a[0]+a[2])/2,(a[1]+a[0])/2
    c+=1
print(c)

Buggy python submission (verdict: Runtime Error):
a = lma()
f = 1
c =0
while f:
    if (a[0] == a[1] and a[0] == a[2]) :
        c=-1
        break
    if a[0]%2==1 or a[1]%2==1 or a[2]%2 ==1:break
    a[0],a[1],a[2] = (a[1]+a[2])/2,(a[0]+a[2])/2,(a[1]+a[0])/2
    c+=1
print(c)

Fixed submission:
def lma():return list(map(int, input().split()))#x or y
a = lma()
f = 1
c =0
while f:
    if a[0]%2==1 or a[1]%2==1 or a[2]%2 ==1:break
    if (a[0] == a[1] and a[0] == a[2]) :
        c=-1
        break
    a[0],a[1],a[2] = (a[1]+a[2])/2,(a[0]+a[2])/2,(a[1]+a[0])/2
    c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
import collections
e =[]
for i in range(N):
    ta,tb =map(int,input().split())
    e.extend([ta,tb])
c = collections.Counter(e)
#print(c)
ans = "YES"
for i in c:
    if c[i]%2 != 0:
        ans = "NO"
print(ans)


Fixed submission:
N,M=map(int,input().split())
import collections
e =[]
for i in range(M):
    ta,tb =map(int,input().split())
    e.extend([ta,tb])
c = collections.Counter(e)
#print(c)
ans = "YES"
for i in c:
    if c[i]%2 != 0:
        ans = "NO"
print(ans)

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
import collections
e =[]
for i in range(N):
    ta,tb =map(int,input().split())
    e.extend([ta,tb])
c = collections.Counter(e)
print(c)
ans = "YES"
for i in c:
    if c[i]%2 != 0:
        ans = "NO"
print(ans)


Fixed submission:
N,M=map(int,input().split())
import collections
e =[]
for i in range(M):
    ta,tb =map(int,input().split())
    e.extend([ta,tb])
c = collections.Counter(e)
#print(c)
ans = "YES"
for i in c:
    if c[i]%2 != 0:
        ans = "NO"
print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
s = ""
for i in range(len(a)+len(b)):
    if i%2==0:a
        s+=a[i//2]
    else:
        s+=b[i//2]
print(s)

Fixed submission:
a = input()
b = input()
s = ""
for i in range(len(a)+len(b)):
    if i%2==0:
        s+=a[i//2]
    else:
        s+=b[i//2]
print(s)
Buggy python submission (verdict: Runtime Error):
a =int(input())
x =list(map(int, input().split()))
x.sort()
s=0
for i in reversed(range(0,a//3,1):
  s+=x[i+1]
print(s)


Fixed submission:
n = int(input())
A = list(map(int,input().split()))
A.sort()

print(sum(A[n:3*n:2]))

Buggy python submission (verdict: Runtime Error):
a =int(input())
x =list(map(int, input().split()))
x.sort()
s=0
for i in reversed(range(1,(a+1)//3,1):
  s+=x[i]
print(s)


Fixed submission:
n = int(input())
A = list(map(int,input().split()))
A.sort()

print(sum(A[n:3*n:2]))

Buggy python submission (verdict: Runtime Error):
a =int(input())
x =list(map(int, input().split()))
x.sort()
s=0
for I in reversed(range(1,a//3,1):
  s+=x[i]
print(s)

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
A.sort()

print(sum(A[n:3*n:2]))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
x = []
z = []
m =19999999999999
s  = 1
for i in range(a):
    ta , tb = map(int, input().split()) 
    x.append([ta,tb])
for i in range(a):
    ta , tb = map(int, input().split())
    z.append([ta,tb])
for ta , tb in x:
    s = 0
    m =19999999999999
    for n,(s,y) in enumerate(z):
        print(n,s,y)
        # print(m , abs(s-ta)+abs(y-tb))
        if m >= abs(s-ta)+abs(y-tb):
            m = abs(s-ta)+abs(y-tb)
            s = n
    print(s+1)

Fixed submission:
n,m=map(int,input().split())
p=[list(map(int,input().split()))for _ in range(n)]
s=[list(map(int,'0'*m))for _ in range(n)]
for j in range(m):
  c,d=map(int,input().split())
  for i in range(n):
    s[i][j]=abs(p[i][0]-c)+abs(p[i][1]-d)
else:
  for i in range(n):print(1+s[i].index(min(s[i])))

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
x = []
m =19999999999999
for i in range(a):
    ta , tb = map(int, input().split()) 
    x.append([ta,tb])
for i in range(b):
    ta , tb = map(int, input().split()) 
    for x,y in x:
        m = min(m,abs(x-ta)+abs(y-tb))
    print(m)

Fixed submission:
n,m=map(int,input().split())
p=[list(map(int,input().split()))for _ in range(n)]
s=[list(map(int,'0'*m))for _ in range(n)]
for j in range(m):
  c,d=map(int,input().split())
  for i in range(n):
    s[i][j]=abs(p[i][0]-c)+abs(p[i][1]-d)
else:
  for i in range(n):print(1+s[i].index(min(s[i])))
Buggy python submission (verdict: Runtime Error):
b = input()
a =int(b)
m = len(b)
for i in reversed(range(1,int(math.sqrt(a))+1)):
    if a/i == int(a/i):
        m = max(len(str(a//i)),len(str(i)))
        break
print(m)

Fixed submission:
import math
b = input()
a =int(b)
m = len(b)
for i in reversed(range(1,int(math.sqrt(a))+1)):
    if a/i == int(a/i):
        m = max(len(str(a//i)),len(str(i)))
        break
print(m)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = 0
if i < 3:print(a)
else:
    for i in range(1,a):

        s+=i
        if s-i < a <= s:
            print(i)
            break

Fixed submission:
a = int(input())
s = 0
if a < 3:print(a)
else:
    for i in range(1,a):

        s+=i
        if s-i < a <= s:
            print(i)
            break
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
s = 1
for i in range(1,a+1):
    s*=i
print(s%1000000007)

Fixed submission:
a = int(input())
s = 1
for i in range(1,a+1):
    s*=i
    s=s%1000000007
print(s)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()

t = ["SS","SW","WS","WW"]

for j in range(4):
  for i in range(1,a):
    if t[j][i] == "S" and b[i] == "o":
      t[j]+="S" if t[j][i-1] == "S" else "W"
    elif t[j][i] == "S" and b[i] == "x":
      t[j]+="S" if t[j][i-1] == "W" else "W"
    elif t[j][i] == "W" and b[i] == "x":
      t[j]+="S" if t[j][i-1] == "S" else "W"
    elif t[j][i] == "W" and b[i] == "o":
      t[j]+="S" if t[j][i-1] == "W" else "W"
    else:
      t[j] = -1
      break
s = -1
if all(i == -1 f

Fixed submission:
a = int(input())
b = input()

t = ["SS","SW","WS","WW"]
l = []
for j in range(4):
  if t[j][0] == "S" and b[0] == "o":
    l.append("S" if t[j][1] == "S" else "W")
  elif t[j][0] == "S" and b[0] == "x":
    l.append("S" if t[j][1] == "W" else "W")
  elif t[j][0] == "W" and b[0] == "x":
    l.append("S" if t[j][1] == "S" else "W")
  elif t[j][0] == "W" and b[0] == "o":
    l.append("S" if t[j][1] == "W" else "W")
  for i in range(1,a):
    if t[j][i] == "S" and b[i] == "o":
      t[j]+="S" if t[j][i-1] == "S" else "W"
    elif t[j][i] == "S" and b[i] == "x":
      t[j]+="S" if t[j][i-1] == "W" else "W"
    elif t[j][i] == "W" and b[i] == "x":
      t[j]+="S" if t[j][i-1] == "S" else "W"
    elif t[j][i] == "W" and b[i] == "o":
      t[j]+="S" if t[j][i-1] == "W" else "W"
    else:
      t[j] = -1
      break
s = -1
if all(i == -1 for i in t):
  print(-1)
else:
  for j,k in enumerate(t):
    # print(j,k)
    # if k !=-1:
    #   if t[j][-1] == "S" and b[-1] == "o" and t[j][0] == "S":
    #     s = t[j]
    #   elif t[j][-1] == "S" and b[-1] == "x" and t[j][0] == "W":
    #     s = t[j]
    #   elif t[j][-1] == "W" and b[-1] == "x" and t[j][0] == "S":
    #     s = t[j]
    #   elif t[j][-1] == "W" and b[-1] == "o" and t[j][0] == "W":
    #     s = t[j]
    if k !=-1:
      if k[-1] ==  k[0] :
        if k[-2] ==l[j]:
          s = k
  if s == -1:print(-1)
  else:print(s[:-1])
Buggy python submission (verdict: Runtime Error):
from itertools import permutations

n,m=map(int,input().split())
path=set()
for _ in range(m):
    u,v=map(int,input().split())
    path|={(u-1,v-1),(v-1,u-1)}
s = 0
for i in permutations(range(n)):
    s+=(all((h,j) in path for h,j in zip(i[1:],i))) if i[0] ==0
print(s)

Fixed submission:
#########
#thiking Face
from itertools import permutations

n,m=map(int,input().split())
path=set()
for _ in range(m):
    u,v=map(int,input().split())
    path|={(u-1,v-1),(v-1,u-1)}

print(sum(all((u,v) in path for u,v in zip(p,p[1:]))
          for p in permutations(range(n)) if p[0]==0))

Buggy python submission (verdict: Runtime Error):

#########
#thiking Face
from itertools import permutations

n,m=map(int,input().split())
path=set()
for _ in range(m):
    u,v=map(int,input().split())
    path|={(u-1,v-1),(v-1,u-1)}

print(sum(all((u,v) in es for u,v in zip(p,p[1:]))
          for p in permutations(range(n)) if p[0]==0))


Fixed submission:
#########
#thiking Face
from itertools import permutations

n,m=map(int,input().split())
path=set()
for _ in range(m):
    u,v=map(int,input().split())
    path|={(u-1,v-1),(v-1,u-1)}

print(sum(all((u,v) in path for u,v in zip(p,p[1:]))
          for p in permutations(range(n)) if p[0]==0))

Buggy python submission (verdict: Runtime Error):
###########

#########
#thiking Face
from itertools import permutations

n,m=map(int,input().split())
path=set()
for _ in range(m):
    u,v=map(int,input().split())
    path|={(u-1,v-1),(v-1,u-1)}

print(sum(all((u,v) in es for u,v in zip([0]+p,p))
          for p in permutations(range(1,n))))



Fixed submission:
#########
#thiking Face
from itertools import permutations

n,m=map(int,input().split())
path=set()
for _ in range(m):
    u,v=map(int,input().split())
    path|={(u-1,v-1),(v-1,u-1)}

print(sum(all((u,v) in path for u,v in zip(p,p[1:]))
          for p in permutations(range(n)) if p[0]==0))
Buggy python submission (verdict: Runtime Error):
a = int(input())
x= list(map(int, input().split()))

for i in x:
    if i%2!=0:
        s+=1
if s%2==0:
    print("YES")
else:print("NO")

Fixed submission:
a = int(input())
x= list(map(int, input().split()))
s=0
for i in x:
    if i%2!=0:
        s+=1
if s%2==0:
    print("YES")
else:print("NO")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

K = sum(A) / sum(range(1, N+1))
for i in range(-1,N-1):
    D = A[i+1] - A[i] - K 

for d in D:
    if not (d <= 0 and d % N == 0):
        print("NO")
        break
else:
    print("YES")


Fixed submission:
N = int(input())
A = list(map(int, input().split()))

K = sum(A) / sum(range(1, N+1))
D = []
for i in range(-1,N-1):
    D.append(A[i+1] - A[i] - K )

for d in D:
    if not (d <= 0 and d % N == 0):
        print("NO")
        break
else:
    print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
k,n = map(int, input().split())
res = 0
for i in range(k+1):
    for j in range(k+1):
        if i + j > n : break
        h = n - i - j
        if h <= k:
            res +=1
            x =[i,j,h]
print(res)

Fixed submission:
k,n = map(int, input().split())
res = 0
for i in range(k+1):
    for j in range(k+1):
        if i + j > n : break
        h = n - i - j
        if h <= k:
            res +=1
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
k,n = map(int, input().split())
res = 0
for i in range(k+1):
    for j in range(k+1):
        for h in range(k+1):
            if i+j+h==n:
                res +=1
                x =[i,j,h]
print(res)

Fixed submission:
k,n = map(int, input().split())
res = 0
for i in range(k+1):
    for j in range(k+1):
        if i + j > n : break
        h = n - i - j
        if h <= k:
            res +=1
print(res)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
a = list(map(int, input().split()))

sa = [0]
sb = [0]
for i in range(N):
    sa.append(sa[-1] + a[i])
    sb.append(sb[-1] + max(0, a[i]))

ans = 0
for i in range(N - K + 1):
	a = sa[i + K] - sa[i]
	b = sb[i + K] - sb[i]
    ans = max(ans, sb[N] - b + max(a, 0))

print(ans)


Fixed submission:
N, K = map(int, input().split())
a = list(map(int, input().split()))

sa = [0]
sb = [0]
for i in range(N):
    sa.append(sa[-1] + a[i])
    sb.append(sb[-1] + max(0, a[i]))

ans = 0
for i in range(N - K + 1):
    a = sa[i + K] - sa[i]
    b = sb[i + K] - sb[i]
    ans = max(ans, sb[N] - b + max(a, 0))
print(ans)
Buggy python submission (verdict: Runtime Error):
a ,b,c= map(str, input().split())
if b =="+":
    print(int(a)+int(b))
elif b =="-":
    print(int(a)-int(b))

Fixed submission:
a ,b,c= map(str, input().split())
if b =="+":
    print(int(a)+int(c))
elif b =="-":
    print(int(a)-int(c))
Buggy python submission (verdict: Runtime Error):

a = int(input())
x = list(map(int, input().split()))
x.sort()
t =[2]
x = x[::-1]
if a == 1:
  if x[0] == 0:print(1)
  else:print(0)
else:
  if a %2 == 0:
    for i in range(1,a,2):
      if not i == x[-1] and i ==x[-2]:
        print(0)
        break
      x.pop()
      x.pop()
    else:print(2**(a//2))
  else:
    if x.pop() != 0:
      print(0)
      exit()
    for i in range(0,a,2):
      if not i == x[-1] and i ==x[-2]:
        print(0)
        break
      x.pop()
      x.pop()
    else:print(2**(a//2))


Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

A.sort()
B = [abs(a-b) for a,b in zip(range(N-1,-1,-1),range(N))]
B.sort()

if A==B:
    print(pow(2,N//2,10**9+7))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
a = int(input())
x = list(map(int, input().split()))
x.sort()
t =[2]
x = x[::-1]
if a == 1:
  if x[0] == 0:print(1)
  else:print(0)
else:
  if a %2 == 0:
    print(t[3])
    for i in range(1,a,2):
      if not i == x[-1] and i ==x[-2]:
        x.pop()
        x.pop()
        print(0)
        break
    else:print(2**(a//2))
  else:
    if x.pop() != 0:
      print(0)
      exit()
    for i in range(0,a,2):
      if not i == x[-1] and i ==x[-2]:
        x.pop()
        x.pop()
        print(0)
        break
    else:print(2**(a//2))

Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

A.sort()
B = [abs(a-b) for a,b in zip(range(N-1,-1,-1),range(N))]
B.sort()

if A==B:
    print(pow(2,N//2,10**9+7))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
a = int(input())
x = list(map(int, input().split()))
x.sort()
x = x[::-1]
if a %2 == 0:
  for i in range(1,a,2):
    if not i == x[-1] and i ==x[-2]:
      x.pop()
      x.pop()
      print(0)
      break
  else:print(2**(a//2))
else:
  for i in range(0,a,2):
    x.pop()
    if not i == x[-1] and i ==x[-2]:
      x.pop()
      x.pop()
      print(0)
      break
  else:print(2**(a//2))


Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

A.sort()
B = [abs(a-b) for a,b in zip(range(N-1,-1,-1),range(N))]
B.sort()

if A==B:
    print(pow(2,N//2,10**9+7))
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
a = int(input())
x = list(map(int, input().split()))
x.sort()
x = x[::-1]
if a %2 == 0:
  for i in range(1,a,2):
    if not i == x[-1] and i ==x[-2]:
      x.pop()
      x.pop()
      print(0)
      break
  else:print(2**(a//2))
else:
  for i in range(0,a,2):
    x.pop()
    if not i == x[-1] and i ==x[-2]:
      x.pop()
      x.pop()
      print(0)
      break
  else:print(2**(a//2))


Fixed submission:
N = int(input())
A = [int(a) for a in input().split()]

A.sort()
B = [abs(a-b) for a,b in zip(range(N-1,-1,-1),range(N))]
B.sort()

if A==B:
    print(pow(2,N//2,10**9+7))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(str, input().split()))
  for j in range(W):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]+1))

Fixed submission:
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(str, input().split()))
  for j in range(M):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]+1))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(int, input().split()))
  for j in range(W):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]))
  

Fixed submission:
N, M = map(int, input().split())
k = []
for i in range(N):
  t = list(map(str, input().split()))
  for j in range(M):
    if t[j] == "snuke":p = [i,j]
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(abc[p[1]]+str(p[0]+1))
Buggy python submission (verdict: Runtime Error):
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1))
for i ,d in enumerate(x):
    A[d-1] -= a-i
print(*A)
print(*B)


Fixed submission:
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1))
for i ,d in enumerate(x):
    A[d-1] -= a-i
print(*A)
print(*B)

Buggy python submission (verdict: Runtime Error):
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1)+t[x[i-1]])
print(*A)
print(*B)


Fixed submission:
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1))
for i ,d in enumerate(x):
    A[d-1] -= a-i
print(*A)
print(*B)

Buggy python submission (verdict: Runtime Error):
a = int(input())
x = list(map(int,input().split()))
t = [range(1,a+1)]
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1)+t[x[i-1]])
print(*A)
print(*B)



Fixed submission:
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1))
for i ,d in enumerate(x):
    A[d-1] -= a-i
print(*A)
print(*B)

Buggy python submission (verdict: Runtime Error):
a = int(input())
x = list(map(int,input().split()))
t = [range(1,a+1)]
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1)+tpx[i-1]])
print(*A)
print(*B)

Fixed submission:
a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1))
for i ,d in enumerate(x):
    A[d-1] -= a-i
print(*A)
print(*B)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print((a+b)*h/2)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
print(int((a+b)*c/2))
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()

l = list(a)
m = list(b)
n = list(c)
if len(l)>0:
    t = a.pop()
k = 'a'
while len(l) >0 and len(m) > 0 and len(n) > 0:
    k = t
    if t == 'a':
        t = l.pop()
    elif t == 'b':
        t = m.pop()
    elif t == 'c':
        t = n.pop()
print(k)

Fixed submission:
s={i:list(input()) for i in "abc"}
x="a"
while s[x]:
    x=s[x].pop(0)
print(x.upper())

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = input()

l = []
m = []
n = []
t = a.pop()
k = 'a'
while len(l) >0 and len(m) > 0 and len(n) > 0:
    k = t
    if t == 'a':
        t = a.pop()
    elif t == 'b':
        t = b.pop()
    elif t == 'c':
        t = c.pop()
print(k)

Fixed submission:
s={i:list(input()) for i in "abc"}
x="a"
while s[x]:
    x=s[x].pop(0)
print(x.upper())
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = 0
p =[int(input()) for _ in range(a)]
p.append(0)
def cal(n,k,s):
    #print(n,k,s,p[n])
    if n== a:return s
    s +=p[n]//2
    c = p[n]%2
    if p[n+1] >=1 and k == 1:
        s +=1
        p[n+1] -=1
        return cal(n+1,c,s)
    else:return cal(n+1,c,s)
    
print(cal(0,0,0))

Fixed submission:
a = int(input())
s = 0
p =[int(input()) for _ in range(a)]
p.append(0)
for i in range(a):
    s +=p[i]//2
    if p[i+1] >=1 and p[i]%2 == 1:
        s +=1
        p[i+1] -=1
    
print(s)
Buggy python submission (verdict: Runtime Error):
print(2 3)

Fixed submission:
s = input()
t = s[1:]+" "
r = s[2:]+"  "
for n,(i,j,k) in enumerate(zip(s,t,r)):
    if i == j :
        print(n+1,n+2)
        exit()
    elif i == k:
        print(n+1,n+3)
        exit()
print(-1,-1)
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int, input().split())
s = 1
for i in range(a,b+1):
  s *= i
if s < 0:
  print("Negative")
elif s == 0:
  print("Zero")
else:print("Positive")

Fixed submission:
def a():return input()#s
def ai():return int(input())#a,n or k
def ma():return map(int, input().split())#a,b,c,d or n,k
def ms():return map(str, input().split())#,a,b,c,d
def lma():return list(map(int, input().split()))#x or y
def lms():return list(map(str, input().split()))#x or y
k= []
l = []
f = 0
def say(i):return print("Yes" if i == 0 else "No")
def Say(i):return print("YES" if i == 0 else "NO")

a,b = ma()
if a*b > 0 :
    if a+b >0:print("Positive")
    elif abs(b-a+1)%2==0:print("Positive")
    else:print("Negative")
else:print("Zero")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from scipy.misc import comb
mod=10**9+7
h,w,a,b=map(int,input().split())
ans=0
for i in range(b,w):
    ans=(ans+comb(h-a-1+i,i,exact=1)*comb(a-1+w-i-1,w-i-1,exact=1))%mod
print(ans)


Fixed submission:
class BigCombination(object):
    __slots__ = ["mod", "factorial", "inverse"]
 
    def __init__(self, mod  = 10**9+7, max_n = 10**6):
        fac, inv = [1], []
        fac_append, inv_append = fac.append, inv.append
 
        for i in range(1, max_n+1):
            fac_append(fac[-1] * i % mod)
 
        inv_append(pow(fac[-1], mod-2, mod))
 
        for i in range(max_n, 0, -1):
            inv_append(inv[-1] * i % mod)
 
        self.mod, self.factorial, self.inverse = mod, fac, inv[::-1]
 
    def get_combination(self, n, r):
        return self.factorial[n] * self.inverse[r] * self.inverse[n-r] % self.mod
 
    def get_permutation(self, n, r):
        return self.factorial[n] * self.inverse[n-r] % self.mod
 
 
import math
Big = BigCombination()
mod=10**9+7
h,w,a,b=map(int,input().split())
ans=0
for i in range(b,w):
    ans=(ans+ Big.get_combination(h-a-1+i,i)* Big.get_combination(a-1+w-i-1,w-i-1))%mod
print(ans)