Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

if N % 3:
    ans = len(set(A)) == 1
else:
    c = Counter(A)
    if len(c) != 3:
        ans = False
    else:
        x, y, z = c.keys()
        ans = (x | y == z)
print('Yes' if ans else 'No')


Fixed submission:
from collections import Counter

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

c = Counter(A)
if len(c) == 3:
    x, y, z = c.keys()
    ans = (c[x] == c[y] == c[z]) and (x ^ y == z)
elif len(c) == 2:
    ans = (0 in c) and (c[0] * 3 == N)
elif len(c) == 1:
    ans = 0 in c
else:
    ans = False
print('Yes' if ans else 'No')
Buggy python submission (verdict: Runtime Error):
T = list(map(int, (input() for _ in range(5))))
T2 = [math.ceil(t / 10) * 10 for t in T]
m = max(t2 - t for t, t2 in zip(T, T2))
print(sum(T2) - m)

Fixed submission:
import math
 
T = list(map(int, (input() for _ in range(5))))
T2 = [math.ceil(t / 10) * 10 for t in T]
m = max(t2 - t for t, t2 in zip(T, T2))
print(sum(T2) - m)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
C = [int(input()) for _ in range(5)]

P = [N, 0, 0, 0, 0, 0]
for time in range(1, 5 * N):
    for i in range(4, -1, -1):
        P[i+1] += min(C[i], P[i])
        P[i] -= min(C[i], P[i])
    if P[5] == N:
        print(time)
        break


Fixed submission:
from math import ceil

N = int(input())
A = [int(input()) for _ in range(5)]

print(ceil(N / min(A)) + 4)
Buggy python submission (verdict: Runtime Error):
S = input()
l = re.findall(r'[ACGT]+', S)
if l:
  print(max(map(len, l)))
else:
  print(0)


Fixed submission:
S = input()
count, max_count = 0, 0
for s in S:
  if s in 'ACGT':
    count += 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(max_count)

Buggy python submission (verdict: Runtime Error):
import re

S = input()
m = max(map(len, re.findall(r'[ACGT]+', S)))
print(m)


Fixed submission:
S = input()
count, max_count = 0, 0
for s in S:
  if s in 'ACGT':
    count += 1
    if count > max_count:
      max_count = count
  else:
    count = 0
print(max_count)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n, x0 = map(int, input().split())
X = list(map(int, input().split()))

print(np.gcd.reduce([x - x0 for x in X]))


Fixed submission:
from fractions import gcd
from functools import reduce

n, x0 = map(int, input().split())
X = list(map(int, input().split()))

print(reduce(gcd, (abs(x - x0) for x in X)))

Buggy python submission (verdict: Runtime Error):
import math

n, x0 = map(int, input().split())
X = list(map(int, input().split()))

g = X.pop() - x0
for x in X:
    g = math.gcd(g, x - x0)
print(g)


Fixed submission:
from fractions import gcd
from functools import reduce

n, x0 = map(int, input().split())
X = list(map(int, input().split()))

print(reduce(gcd, (abs(x - x0) for x in X)))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))

print(ceil((N - 1) / (K - 1)))


Fixed submission:
from math import ceil

N, K = map(int, input().split())
A = list(map(int, input().split()))

print(ceil((N - 1) / (K - 1)))
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = ['.'*(W+2)] + ['.' + input() + '.' for _ in range(H)] + ['.'*(W+2)]
for i in range(1, H+1):
  for j in range(1, W+1):
    if S[i][j] == '#':
      for x, y in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
        if S[i+x][j+y] == '#':
          break
      else:
        print('No')
        return
else:
  print('Yes')


Fixed submission:
import sys

H, W = map(int, input().split())
S = ['.'*(W+2)] + ['.' + input() + '.' for _ in range(H)] + ['.'*(W+2)]
for i in range(1, H+1):
  for j in range(1, W+1):
    if S[i][j] == '#':
      for x, y in [(-1, 0), (1, 0), (0, -1), (0, 1)]:
        if S[i+x][j+y] == '#':
          break
      else:
        print('No')
        sys.exit()
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())

if N * 10000 >= Y:
  for a in range(Y // 10000 + 1):
    if a * 10000 + (N - a) * 5000 >= Y:
      for b in range((Y - a * 10000) // 5000 + 1):
        c = (Y - a * 10000 - b * 5000) // 1000
        if a + b + c == N:
          print(a, b, c)
          return
print(-1, -1, -1)


Fixed submission:
import sys
 
N, Y = map(int, input().split())
 
if N * 10000 >= Y:
  for a in range(Y // 10000 + 1):
    if a * 10000 + (N - a) * 5000 >= Y:
      for b in range((Y - a * 10000) // 5000 + 1):
        c = (Y - a * 10000 - b * 5000) // 1000
        if a + b + c == N:
          print(a, b, c)
          sys.exit()
print(-1, -1, -1)
Buggy python submission (verdict: Runtime Error):
a = defaultdict(int)
for w in input():
  a[w] += 1
print('Yes' if sum(c % 2 for c in a.values()) == 0 else 'No')


Fixed submission:
from collections import defaultdict

a = defaultdict(int)
for w in input():
  a[w] += 1
print('Yes' if sum(c % 2 for c in a.values()) == 0 else 'No')
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

num = int(input())
an = list(map(int, input().split()))

ans = 0

for i in range(len(an)):
  for j in range(len(an)):
    if i < j:
      kake = an[i] * an[j]
      kake %= ((10 ** 9) + 7)
      ans += kake
  
ans %= ((10 ** 9) + 7)

print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

d, t, s = map(int, input().split())

run = t * s
if d <= run:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
num = input().split(" ")
num_all = int(num[0])
count = int(num[1])
cost = list(map(int, input().split()))
cost.sort()
last = 0
for i in range(count):
  last += cost[i]
print(last)

Fixed submission:
word = input()
if word.islower() == True:
  print("a")
else:
  print("A")
Buggy python submission (verdict: Runtime Error):
a = input().split(" ")
base = int(a[0])
count = int(a[1])
if count == 0:
  print(base)
else:
  num = list(map(int, input().split()))  

  i = 0
  while i <= count:
    if num.count(base - i) == 0:
      print(num.count(base - i))
      print(base - i)
      break
    elif num.count(base + 1) == 0:
      print(num.count(base + i))
      print(base + i)
      break
    else:
      i += 1

Fixed submission:
numbers = input().split(" ")
num = numbers.index("0")
print(num + 1)
Buggy python submission (verdict: Runtime Error):
import math
        
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
ans = T[0]

for i in range(1, N):
    ans = int((ans * T[i]) / math.gcd(ans, T[i]))

print(ans)
    



Fixed submission:
import math
        
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
ans = T[0]

for i in range(1, N):
    ans = ans * T[i] // math.gcd(ans, T[i])

print(ans)

Buggy python submission (verdict: Runtime Error):
import math
        
N = int(input())
T = []
ans = 1
for i in range(N):
    T.append(int(input()))

for i in range(N):
    ans = int((ans * T[i]) / math.gcd(ans, T[i]))

print(ans)
    



Fixed submission:
import math
        
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
ans = T[0]

for i in range(1, N):
    ans = ans * T[i] // math.gcd(ans, T[i])

print(ans)

Buggy python submission (verdict: Runtime Error):
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)
N = int(input())
T = []
ans = 1
for i in range(N):
    T.append(int(input()))

for i in range(N):
    ans = (ans * T[i]) / gcd(ans, T[i]) 

print(int(ans))
    



Fixed submission:
import math
        
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
ans = T[0]

for i in range(1, N):
    ans = ans * T[i] // math.gcd(ans, T[i])

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
a = []
b = []
for i in range(M):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

c = []
clear = 0

for i in range(M):
    if b[i] == N:
        c.append(a[i])

for i in range(M):
    if a[i] == 1 and b[i] in c:
        clear = 1
        break

if clear == 1:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')




Fixed submission:
N, M = map(int, input().split())
a = []
b = []
for i in range(M):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

c = []
d = []

for i in range(M):
    if a[i] == 1:
        c.append(b[i])

for i in range(M):
    if b[i] == N:
        d.append(a[i])

e = set(c) & set(d)

if len(e) != 0:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = []

if n % 2 == 0:
    for i in range(n):
        if i % 2 == 0:
            b.append(a[i])
        else:
            b.insert(0, a[i])
else:
    for i in range(n):
        if i % 2 == 0:
            b.insert(0, a[i])
        else:
            b.append(a[i])


for i in range(n):
    print(b[i],'', end = '')
print()


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

if n % 2 == 0:
    for i in range(n):
        if i < int(n / 2):
            print(a[n - 2 * i - 1],'', end = '')
        else:
            print(a[2 * i - n],'', end = '')
else:
    for i in range(n):
        if i <= n // 2:
            print(a[n - 2 * i - 1],'', end = '')
        else:
            print(a[2 * i - n],'', end = '')
print()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    b.append(a[i])
    b = [b[i] for i in reversed(range(len(b)))]

for i in range(n):
    print(b[i],'', end = '')
print()


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

if n % 2 == 0:
    for i in range(n):
        if i < int(n / 2):
            print(a[n - 2 * i - 1],'', end = '')
        else:
            print(a[2 * i - n],'', end = '')
else:
    for i in range(n):
        if i <= n // 2:
            print(a[n - 2 * i - 1],'', end = '')
        else:
            print(a[2 * i - n],'', end = '')
print()
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
a = []
for i in range(N):
    x, y = map(int, input().split())
    for j in range(y):
        a.append(x)
a.sort()

print(a[K - 1])

Fixed submission:
N, K = map(int, input().split())
a = []
b = []
Sum = 0
for i in range(N):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)
s = [*range(len(a))]
sort_s = sorted(s, key = lambda i: a[i])
sort_a = [a[i] for i in sort_s]
sort_b = [b[i] for i in sort_s]
for i in range(N):
    Sum += sort_b[i]
    if Sum >= K:
        print(sort_a[i])
        break
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

A.sort()
i = 0
print(A)
while i < len(A) - 2:
    if A[i] == A[i + 1]:
        A.pop(i)
        A.pop(i + 2)
    else:
        i += 1
    print(i,A)

if A[-1] == A[-2]:
    print(len(A) - 1)
else:
    print(len(A))
        



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

B = list(set(A))

if len(B) % 2 == 0:
    print(len(B) - 1)
else:
    print(len(B))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
i = 0

while i < len(A) - 2:
    if A[i] == A[i + 1]:
        A.pop(i)
        A.pop(i + 2)
        i -= 1
    else:
        i += 1

print(len(A))
        



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

B = list(set(A))

if len(B) % 2 == 0:
    print(len(B) - 1)
else:
    print(len(B))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
i = 0

while i < len(A) - 2:
    if A[i] == A[i + 1]:
        A.pop(i)
        A.pop(i + 2)
    else:
        i += 1

print(len(A))
        



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

B = list(set(A))

if len(B) % 2 == 0:
    print(len(B) - 1)
else:
    print(len(B))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
i = 1

while i < len(A) - 1:
    if A[i] == A[i - 1] or A[i] == A[i + 1]:
        A.pop(i - 1)
        A.pop(i + 1)
    i += 1

print(len(A))
        



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

B = list(set(A))

if len(B) % 2 == 0:
    print(len(B) - 1)
else:
    print(len(B))
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import operator

N = int(input())
A = list(map(int, input().split()))
AA = []

for i in range(len(list(itertools.combinations(A, 2)))):
    n = list(itertools.combinations(A, 2))
    if n[i][0]*n[i][1] >= (10**9+7):
        num = n[i][0]*n[i][1]%(10**9 +7)

    AA.append(n[i][0]*n[i][1])


if sum(AA) >= (10**9 +7):
    print(sum(AA)%(10**9 +7))
else:
    print(sum(AA))


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

mod = 10**9 + 7
S = sum(A)%mod
ans = 0

for x in A:
    S -= x
    S %= mod
    ans += S * x
    ans %= mod

ans %= mod
print(ans)
Buggy python submission (verdict: Runtime Error):
K = int(input())
mod = []
a[0] = 7%K
for i in range(1,K):
    a[i] = (a[i-1]*10 + 7)%K
 
for i in range(K):
    if a[i] == 0:
        print(a[i])
        break
 
else:
    print(-1)

Fixed submission:
K = int(input())

n = 0
for i in range(1,K+1):
    n = (n*10 + 7)%K
    if n == 0:
        print(i)
        break

else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
K = int(input())
mod = []
a[0] = 7%K
if a[0] == 0:
    print(a[0])
    exit()
for i in range(1,K+1):
    a[i] = (a[i-1]*10 + 7)%K
    if a[i] == 0:
        print("%d",a[i])
        break

else:
    print(-1)

Fixed submission:
K = int(input())

n = 0
for i in range(1,K+1):
    n = (n*10 + 7)%K
    if n == 0:
        print(i)
        break

else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
K = int(input())
mod = []
a[0] = 7%K
if a[0] == 0:
    print(a[0])
    exit()
for i in range(1,K):
    a[i] = (a[i-1]*10 + 7)%K
    if a[i] == 0:
        print("%d",a[i])
        break

else:
    print(-1)

Fixed submission:
K = int(input())

n = 0
for i in range(1,K+1):
    n = (n*10 + 7)%K
    if n == 0:
        print(i)
        break

else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
K = int(input())
mod = []
a[0] = 7%K
for i in range(1,K):
    a[i] = (a[i-1]*10 + 7)%K

for i in range(K):
    if a[i] == 0:
        print("%d",a[i])
        break

else:
    print(-1)

Fixed submission:
K = int(input())

n = 0
for i in range(1,K+1):
    n = (n*10 + 7)%K
    if n == 0:
        print(i)
        break

else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
c = list(map(str, input().split()))

a=0
b=0

a = c.count("R")
ans = c.count("R")
for i in range(N):
    if c[i] == 'R':
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now)

print(ans)

Fixed submission:
N = int(input())
c = list(input())

a=0
b=0

a = c.count("R")
ans = c.count("R")
for i in range(N):
    if c[i] == "R":
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now)

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
c = list(map(str, input().split()))

a=0
b=0

a = c.count("R")

for i in range(N):
    if c[i] == 'R':
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now)

print(ans)


Fixed submission:
N = int(input())
c = list(input())

a=0
b=0

a = c.count("R")
ans = c.count("R")
for i in range(N):
    if c[i] == "R":
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now)

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
c = list(map(str, input().split()))

a=0
b=0

a = c.count("R")

for i in range(N):
    if S[i] == 'R':
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now)

print(ans)

Fixed submission:
N = int(input())
c = list(input())

a=0
b=0

a = c.count("R")
ans = c.count("R")
for i in range(N):
    if c[i] == "R":
        a -= 1
    else:
        b += 1

    now = max(a,b)
    ans = min(ans, now)

print(ans)
Buggy python submission (verdict: Runtime Error):
import sympy
import sys
sys.setrecursionlimit(10**6)

N = int(input())
div = []
for i in range(1,N+1):
    f = sympy.divisor_count(i)
    div.append(f*i)

print(sum(div))

Fixed submission:
a = int(input())
print(a+a**2+a**3)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

total =[]

N, K = map(int, input().split())
p = list(map(int, input().split()))

for i in itertools.combinations(p, K):
    total.append(sum(i))

print(min(total))


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

m = []
for i in range(K):
    a = min(p)
    m.append(a)
    p.remove(a)

print(sum(m))
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())

for i in range(X+1):
    foot=i*2+(X-i)*4
    if foot==Y:
        print('Yes')
        exit()

print('No')

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

for i in range(5):
    if x[i] == 0:
        print(i+1)
    else:
      pass
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

sq=A[0]
for i in range(1,N):
    sq *= A[i]

if sq>10**18:
    print(-1)
else:
    print(sq)

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


if 0 in A:
    print(0)
else:
    sq=A[0]
    for i in range(1,N):
        sq *= A[i]

        if sq>10**18:
            print(-1)
            exit()

    print(sq)
Buggy python submission (verdict: Runtime Error):
A, B, C, K = map(int, input().split())

if A >= K:
    print(K)
elif  A < K <= A+B:
    print(A)
elif A+B < K <= A+B+C:
    print(A-(K-A-B))

Fixed submission:
S = str(input())
T = str(input())
a = 0


if len(T)-len(S)==1:
    for i in range(len(S)):
        if S[i] == T[i]:
            a += 1

if a == len(S):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())

if S < W:
    print('unsafe')
else:
    print('safe')

Fixed submission:
S, W = map(int,input().split())

if S <= W:
    print('unsafe')
else:
    print('safe')

Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())

if S <= W:
    print('unsafe')
else:
    print('safe')


Fixed submission:
S, W = map(int,input().split())

if S <= W:
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [str(input()) for _ in range(N)]

S = list(S)

for i in range(N):
    for j in range(N-1):
        if S[i] == S[j+1]:
            X = N - 1

print(X)

Fixed submission:
import collections

num = int(input())
S = [str(input()) for _ in range(num)]

print(len(collections.Counter(S)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(1, N+1):
    print(A.count(i))

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

l = [0]*N

for i in A:
    l[i-1] += 1

print(*l, sep="\n")
Buggy python submission (verdict: Runtime Error):
x = input()
N = 0

for i in range(x):
    if i%3==0 and i%5==0:
        i = 'FizzBuzz'
    elif i%3==0:
        i = 'Fizz'
    elif i%5==0:
        i = 'Buzz'
    else:
        N = i + N
        
print(N)

Fixed submission:
x = int(input())
N = 0
 
for i in range(1,x+1):
    if i%3==0 and i%5==0:
        pass
    elif i%3==0:
        pass
    elif i%5==0:
        pass
    else:
        N = i + N
        
print(N)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

A = sum(a)
a.sort(reverse=True)
print(a)

if a[m-1] >= A/(4*m):
    print("No")
else:
    print("Yes")

Fixed submission:
a, b, c = input().split()

a1 = b
b1 = a
a2 = c
c1 = a1

print(a2, b1, c1)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

A = sum(a)
a.sort(reverse=True)

if a[m-1] >= A/(4*m):
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c = input().split()

a1 = b
b1 = a
a2 = c
c1 = a1

print(a2, b1, c1)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

A = sum(a)
l = a.sort(reverse=True)

if l[m-1] >= A/(4*m):
    print("Yes")
else:
    print("No")

Fixed submission:
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

A = sum(a)
a.sort(reverse=True)

if a[m-1] >= A/(4*m):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
coffee = input()

if coffee[2] = coffee[3] and coffee[4] = coffee[5]:
    print("Yes")
else:
    print("No")

Fixed submission:
coffee = input()

if coffee[2] == coffee[3] and coffee[4] == coffee[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = str(input())

S.replace("hi", "")
if S = "":
  print("Yes")
else:
  print("No")

Fixed submission:
S = str(input())
 
S1 = S.replace("hi", "")
if S1 == "":
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n = input()

for i in (len(n) - 1):
    if n[i] == h and n[i+1] ==i:
        print("Yes")
    else:
        print("No")

Fixed submission:
S = str(input())
 
S1 = S.replace("hi", "")
if S1 == "":
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n = input()

for i in (len(n)):
    if n[i] == h and n[i+1] ==i:
        print("Yes")
    else:
        print("No")

Fixed submission:
S = str(input())
 
S1 = S.replace("hi", "")
if S1 == "":
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
h = int(input())

print(2(a+b)*h)

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

print(int((a+b)*h/2))
Buggy python submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())

AC=0

if N > K:
    for _ in range(K):
        AC += X
    
    for _ in range(N-K):
        AC += Y

    print(AC)

else:
    for _ in range(K):
        AC += X
        print(AC)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

AC=0

for i in range(1,N+1):
    if i <= K:
        AC += X
    else:
        AC += Y

print(AC)
Buggy python submission (verdict: Runtime Error):
s = input()

n = s.index('B')

s.pop(n-1)
print(s)

Fixed submission:
s = str(input())

ans = []

for i in range(len(s)):
    if s[i] == '1':
        ans.append('1')
    elif s[i] == '0':
        ans.append('0')
    elif s[i] == 'B':
        ans = ans[:-1]

print(''.join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
mod = 1000000007
n = int(input())
a = list(map(int,input().split()))
ans = 0
s = sum(a)
for i in range(n-1):
    b = (s-sum(a[:i+1]))%mod
    ans += (a[i]*(b))%mod
print(ans%mod)

Fixed submission:
mod = 1000000007
n = int(input())
a = list(map(int,input().split()))
ans = 0
b = sum(a)
for i in range(n-1):
    b = b-a[i]
    ans += (a[i]*(b))%mod
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
mod = 1000000007
n = int(input())
a = list(map(int,input().split()))
import itertools
b = list(itertools.combinations(a, 2))
#print(b)
for i in range(len(b)):
    b[i] = (b[i][0]*b[i][1])%mod
print(sum(b)%mod)

Fixed submission:
mod = 1000000007
n = int(input())
a = list(map(int,input().split()))
ans = 0
b = sum(a)
for i in range(n-1):
    b = b-a[i]
    ans += (a[i]*(b))%mod
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
mod = 1000000007
n = int(input())
a = list(map(int,input().split()))
import itertools
b = list(itertools.combinations(a, 2))
#print(b)
for i in range(len(b)):
    b[i] = b[i][0]*b[i][1]
print(sum(b)%mod)

Fixed submission:
mod = 1000000007
n = int(input())
a = list(map(int,input().split()))
ans = 0
b = sum(a)
for i in range(n-1):
    b = b-a[i]
    ans += (a[i]*(b))%mod
print(ans%mod)