Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
ans = 0
s = set()
keta = set()
for i in range(m):
    preans = sc[i][1]*(10**(n-sc[i][0]))
    if sc[i][0] in keta and preans not in s:
        print(-1)
        break
    elif sc[i][0]  not in keta:
        ans += preans
        s.add(preans)
        keta.add(sc[i][0])
else:
    if n not in keta::
        print(ans + 10**(n-1))
    elif len(str(ans)) == n:
        print(ans)
    else:
        print(-1)


Fixed submission:
n, m = map(int, input().split())
sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
ans = 0
s = set()
keta = set()
for i in range(m):
    preans = sc[i][1]*(10**(n-sc[i][0]))
    if sc[i][0] in keta and preans not in s:
        print(-1)
        break
    elif sc[i][0]  not in keta:
        ans += preans
        s.add(preans)
        keta.add(sc[i][0])
else:
    if n == 1 and m == 0:
        print(0)
    elif 1 not in keta:
        print(ans + 10**(n-1))
    elif len(str(ans)) == n:
        print(ans)
    else:
        print(-1)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
ans = 0
s = set()
keta = set()
for i in range(m):
    preans = sc[i][1]*(10**(n-sc[i][0]))
    if sc[i][0] in keta and preans not in s:
        print(-1)
        break
    elif sc[i][0]  not in keta:
        ans += preans
        s.add(preans)
        keta.add(sc[i][0])
else:
    if n not in keta::
        print(ans + 10**(n-1))
    elif len(str(ans)) == n:
        print(ans)
    else:
        print(-1)


Fixed submission:
n, m = map(int, input().split())
sc = []
for i in range(m):
    sc.append(list(map(int, input().split())))
ans = 0
s = set()
keta = set()
for i in range(m):
    preans = sc[i][1]*(10**(n-sc[i][0]))
    if sc[i][0] in keta and preans not in s:
        print(-1)
        break
    elif sc[i][0]  not in keta:
        ans += preans
        s.add(preans)
        keta.add(sc[i][0])
else:
    if n == 1 and m == 0:
        print(0)
    elif 1 not in keta:
        print(ans + 10**(n-1))
    elif len(str(ans)) == n:
        print(ans)
    else:
        print(-1)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
s = []
sump = 0
for i in range(n):
  sump += (p[i] + 1) / 2
  s.append(sump)
  
ans = set()
for i in range(k, n):
  ans.add(s[i]-s[i-k])
  
if n == 1:
  print(s[0])
else:
  print(max(ans))

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
m = sum(p[0: k])
sump = m

for i in range(1, n-k+1):
  sump = sump - p[i-1] + p[i+k-1]
  if m < sump:
    m = sump

ans = (m + k) / 2

print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
s = []
sump = 0
for i in range(n):
  sump += (p[i] + 1) / 2
  s.append(sump)
  
ans = set()
for i in range(k, n):
  ans.add(s[i]-s[i-1])
  
if n == 1:
  print(s[0])
else:
  print(max(ans))

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
m = sum(p[0: k])
sump = m

for i in range(1, n-k+1):
  sump = sump - p[i-1] + p[i+k-1]
  if m < sump:
    m = sump

ans = (m + k) / 2

print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
s = []
sump = 0
for i in range(n):
  sump += (p[i] + 1) / 2
  s.append(sump)
  
ans = set()
for i in range(k, n):
  ans.add(s[i]-s[i-k])
  
print(max(ans))

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
m = sum(p[0: k])
sump = m

for i in range(1, n-k+1):
  sump = sump - p[i-1] + p[i+k-1]
  if m < sump:
    m = sump

ans = (m + k) / 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
x = 0
m = 0

for i in range(n-k+1):
  if sum(p[i:i+k]) > m:
    m = sum(p[i:i+k])
    x = i

ans = 0    
for i in range(x, x+k):
  ans += (p[i] + 1) / 2

print("{0:.12f}".format(ans))

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
m = sum(p[0: k])
sump = m

for i in range(1, n-k+1):
  sump = sump - p[i-1] + p[i+k-1]
  if m < sump:
    m = sump

ans = (m + k) / 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = list(map(int, input().split()))

p1 = []
for i in p:
  p1.append((i+1) / 2)
  
ans = 0

for i in range(n-k+1):
  if sum(p1[i:i+k]) > ans:
    ans = sum(p1[i:i+k])
   
  
print("{0:.12f}".format(ans))

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
  
m = sum(p[0: k])
sump = m

for i in range(1, n-k+1):
  sump = sump - p[i-1] + p[i+k-1]
  if m < sump:
    m = sump

ans = (m + k) / 2

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h2 = sorted(h)

ans = 0
for i in range(n-k):
  ans += h2[0]
  del h2[0]
  
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h2 = sorted(h)

if n<k:
  print(0)
else:
  print(sum(h2[0:n-k]))

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))

ans = 0
for i in range(n-k):
  ans += min(h)
  h.remove(min(h))
  
print(ans)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h2 = sorted(h)

if n<k:
  print(0)
else:
  print(sum(h2[0:n-k]))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans1 = 0
ans2 = 0
preans2 = 0
check = 0
t = []
pret = []

for i in range(m):
  pret = list(map(str, input().split()))
  t.append(pret)
  
for i in range(m):
  if t[i][1] == "WA":
    if check = 0:
      preans2 += 1
  else:
    if check = 0:
      ans1 += 1
      ans2 += preans2
      preans2 = 0
      check += 1
    else:
      ans1 += 1
      check += 1
  if i > 0:
    if t[i][0] != t[i-1][0]:
      check = 0
      
print(ans1, ans2)

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

ac = 0
wa = 0
dwa = {}
d = {}

for i in range(m):
  p, s = input().split()
  if d.get(p) == "AC":
    continue
  if p not in dwa:
    dwa[p] = 0
  if s == "WA":
    dwa[p] += 1
  else:
    ac += 1
    wa += dwa[p]
  d[p] = s
  
print(ac, wa)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
S = input().rstrip().split("")
T = input().rstrip().split("")
 
tekichu = 0
 
for i in range(3):
	if S[i] == T[i]:
		tekichu += 1
 
print(tekichu)

Fixed submission:
s = list(input())
t = list(input())

cnt = 0
for i in range(3):
  if s[i] == t[i]:
    cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
yohou = input().rstrip().split("")
tenki = input().rstrip().split("")
 
tekichu = 0
 
for i in range(3):
	if yohou[i] == tenki[i]:
		tekichu += 1
 
print(tekichu)

Fixed submission:
s = list(input())
t = list(input())

cnt = 0
for i in range(3):
  if s[i] == t[i]:
    cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
yohou = input().rstrip().split("")
tenki = input().rstrip().split("")
 
tekichu = 0
 
for i in range(3):
	if yohou[i] == tenki[i]:
	tekichu += 1
 
print(tekichu)

Fixed submission:
s = list(input())
t = list(input())

cnt = 0
for i in range(3):
  if s[i] == t[i]:
    cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
yohou = input().split("")
tenki = input().split("")
 
tekichu = 0
 
for i in range(0,3):
  if yohou[i] == tenki[i]:
    tekichu += 1
 
print(tekichu)


Fixed submission:
s = list(input())
t = list(input())

cnt = 0
for i in range(3):
  if s[i] == t[i]:
    cnt += 1

print(cnt)

Buggy python submission (verdict: Runtime Error):
yohou[] = input().split("")
tenki[] = input().split("")

tekichu = 0

for i in range(0,3):
  if yohou[i] == tenki[i]:
    tekichu += 1

print(tekichu)

Fixed submission:
s = list(input())
t = list(input())

cnt = 0
for i in range(3):
  if s[i] == t[i]:
    cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
line = input().split(" ")
 
n = 0
 
while n >= 0:
	if n*(int(line[0])-1) >= int(line[1])-int(line[0]):
		break
	else:
		n += 1
 
input(str(n+1))

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

cnt = 1
k = a

while k < b:
  k += a-1
  cnt += 1

if b == 1:
  print(0)
else:
  print(cnt)

Buggy python submission (verdict: Runtime Error):
ab = input().split(" ")

n = 0

while n >= 0:
	if n*(ab[0]-1) >= ab[1]-ab[0]:
		break
	else:
		n += 1

input(n+1)

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

cnt = 1
k = a

while k < b:
  k += a-1
  cnt += 1

if b == 1:
  print(0)
else:
  print(cnt)
Buggy python submission (verdict: Runtime Error):
k=int(input())

if k%2==0 or k%5==0:
    print('-1')

else:
    num=7%k
    ans=1

    while num != 0:

        num=(num*10+7)%k
        ans+=1

print(ans)


Fixed submission:
k=int(input())

if k%2==0 or k%5==0:
    print('-1')

else:
    num=7%k
    ans=1

    while num != 0:

        num=(num*10+7)%k
        ans+=1

    print(ans)
Buggy python submission (verdict: Runtime Error):
x=list(map(int,input().split()))

i=1
while i<=len(x):
    
    if x[i]==0:
        print(i)
    
    i+=1

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

i=1
while i<=len(x):
    
    if x[i-1]==0:
        print(i)
    
    i+=1
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = input()

a = list(map(int, input().split()))

res = np.prod(a)

if res > 10**18 :
    print('-1')

else:
    print(res)

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

print(a*b)
Buggy python submission (verdict: Runtime Error):
# 入力をintにして変数に格納
a, b, c, k = map(int, input().split())

# KとA,Bの大きさに応じて場合分けして最大値計算
if( a+b >= k ):
    max = k

elif( a+b <= k ):
    max = a - ( k - a - b )

# 結果を出力
print(max)

Fixed submission:
s = input()

t = input()

str = s + t[-1]

if str == t:
  print('Yes')
  
else :
  print('No')

Buggy python submission (verdict: Runtime Error):
# 入力をintにして変数に格納
a, b, c, k = map(int, input().split())

# KとA,Bの大きさに応じて場合分けして最大値計算
if( a+b >= k ):
    max = k

elif( a+b <= k ):
    max = a - ( k - a - b )

else:
    sys.exit(1)

# 結果を出力
print(max)

Fixed submission:
s = input()

t = input()

str = s + t[-1]

if str == t:
  print('Yes')
  
else :
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
t=input()

ans=0
i=0
while i<len(s):

    if s[i]==t[i]:
        ans+=1

print(ans)

Fixed submission:
s=input()
t=input()

ans=0
i=0
while i<len(s):

    if s[i]==t[i]:
        ans+=1

    i+=1
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())

if k=1:
    print('0')

else:

    ans=n-k
    print(ans)	

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

if k==1:
    print('0')

else:

    ans=n-k
    print(ans)
Buggy python submission (verdict: Runtime Error):
l=list(map(int,input()))

l.sort()

print(l[0]*l[1]//2)

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

l.sort()

print(l[0]*l[1]//2)
Buggy python submission (verdict: Time Limit Exceeded):
s=list(input())

num = s.count('W')

position = 0
for i in range(len(s)):

    if s[i] == 'B':
        position=i
        break

ans = 0

while num>0:

    for j in range(len(s)-1):

        if s[j]=='B' and s[j+1]=='W':

            s[position]='W'
            s[j+1]='B'

            position+=1
            dist = j+2-position
            ans+=dist
            num-=1

            break

print(ans)

Fixed submission:
s=list(input())

num = s.count('W')

before = 0
for i in range(len(s)):

    if s[i]=='W':
        before += i


after = 0
for j in range(num):
    after+=j

print(before-after)
Buggy python submission (verdict: Time Limit Exceeded):
x=int(input())
a=int(input())
b=int(input())

af=x-a

while af>0:
    af-b

print(af)

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

ans=x-a

while ans>=b:
    ans=ans-b

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

arr=[]

for i in range(n):

    a=int(input())

    if a in arr:
      	arr.remove(a)

    else:
        arr.append(a)


print(len(arr))

Fixed submission:
import collections

n=int(input())

arr=[]

for i in range(n):

    a=int(input())
    arr.append(a)

c = collections.Counter(arr)

ans=0

for j in c.values():
    if j % 2 != 0:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

ans=0
arr=[]

for i in range(n):

    a=int(input())

    if a in arr:
        
        ans-=1
        arr.remove(a)

    else:

        ans+=1
        arr.append(a)


print(ans)

Fixed submission:
import collections

n=int(input())

arr=[]

for i in range(n):

    a=int(input())
    arr.append(a)

c = collections.Counter(arr)

ans=0

for j in c.values():
    if j % 2 != 0:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
import sys
N=int(sys.stdin.readline())
A=list(map(int,sys.stdin.readline().split()))
Q=int(sys.stdin.readline())
AA=set(A)
A=np.array(A)
b=[]
c=[]
for _ in range(Q):
  B,C=map(int,sys.stdin.readline().split())
  if B in AA:
    A[A==B]=C
    AA.add(C)
  print(sum(A))


Fixed submission:
a=str(input())
if a.isupper():
    print("A")
else:
    print("a")

Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
A=np.array(A)
for _ in range(Q):
  B,C=map(int,input().split())
  A[A==B]=C
  print(sum(A))


Fixed submission:
a=str(input())
if a.isupper():
    print("A")
else:
    print("a")
Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
i=0
while i >=0:
    for j in range(-100,101):
        if i**5-j**5==X:
            print(str(i)+" "+str(j))
            break
    else:
        i=i+1
        continue
    break

Fixed submission:
X=int(input())
for i in range(-200,201):
    for j in range(-200,201):
        if i**5-j**5==X:
            print(str(i)+" "+str(j))
            break
    else:
        continue
    break
Buggy python submission (verdict: Runtime Error):
A,B,N=map(int,input().split())
if N>=B:
    print(int(A*(B-1)/B)-A*int((B-1)/B))
else:
    print(int(A*N/B)-A*int(N/B))

Fixed submission:
K=int(input())
A,B=map(int,input().split())
a=0
for i in range(A,B+1):
    if i%K==0:
        a=1
        print("OK")
        break
if a!=1:
    print("NG")
Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
tmp=0
for i in range(N+1):
    a=int(A*i/B)-A*int(i/B)
    tmp=max(a,tmp)
print(tmp)

Fixed submission:
A,B,N=map(int,input().split())
if N>=B:
    print(int(A*(B-1)/B)-A*int((B-1)/B))
else:
    print(int(A*(N)/B)-A*int(N/B))

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
tmp=0
for i in range(N+1):
    a=int(A*i/B)-A*int(i/B)
    tmp=max(a,tmp)
print(tmp)

Fixed submission:
A,B,N=map(int,input().split())
if N>=B:
    print(int(A*(B-1)/B)-A*int((B-1)/B))
else:
    print(int(A*(N)/B)-A*int(N/B))
Buggy python submission (verdict: Runtime Error):
S=str(input())
ans=0
N=len(S)
for i in range(N):
    j=i+4
    while j<=N:
        if int(S[i:j])%2019==0:
            ans+=1
            i=j+1
            j=j+4
        else:
            j=j+1
print(ans)

Fixed submission:
S,W=map(int,input().split())
if W>=S:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
b=[]
for i in range(1,N+1):
    b.append(A.count(i))
for i in b:
    print(i)

Fixed submission:
import math
R = int(input())
print(2*R*math.pi)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
b=[]
for i in range(1,N+1):
    b.append(A.count(i))
for i in b:
    print(i)

Fixed submission:
import math
R = int(input())
print(2*R*math.pi)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
a=set(A)
for i in range(1,N+1):
    if i in a:
        print(A.count(i))
    else:
        print(0)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
b=[0]*N
for i in A:
    b[i-1]+=1
for j in b:
    print(j)

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()))
b=[0]*N
for i in A:
    b[i-1]+=1
for j in b:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
a=list(set(A))
for i in range(1,N+1):
    if i in a:
        print(A.count(i))
    else:
        print(0)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
b=[0]*N
for i in A:
    b[i-1]+=1
for j in b:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
a=list(set(A))
for i in range(1,N+1):
    if i in a:
        print(A.count(i))
    else:
        print(0)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
b=[0]*N
for i in A:
    b[i-1]+=1
for j in b:
    print(j)
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
import math
b_list=[]
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            a=math.gcd(i,j)
            b=math.gcd(a,k)
            b_list.append(b)
print(sum(b_list))

Fixed submission:
K = int(input())
import math
b_list=[]
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            a=math.gcd(i,j)
            b=math.gcd(a,k)
            b_list.append(b)
print(sum(b_list))

Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())

def gcd(m,n):
    x=max(m,n)
    y=min(m,n)
    if x%y==0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        return z

b_list=[]
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            a=gcd(i,j)
            b=gcd(a,k)
            b_list.append(b)
print(sum(b_list))

Fixed submission:
K = int(input())
import math
b_list=[]
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            a=math.gcd(i,j)
            b=math.gcd(a,k)
            b_list.append(b)
print(sum(b_list))
Buggy python submission (verdict: Runtime Error):
s = input()
if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No)

Fixed submission:
from sys import stdin


inp = stdin.readline

t = inp().strip()

if t[2] == t[3] and t[4] == t[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 1
for i in range(0, n):
  b = int(input())
  ans *= b
if a > 10**18:
   print(-1)
else:
  print(ans)
  



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

if 0 in a:
  print(0)
  
else:
  ans = 1
  for val in a:
    ans *= val
    if ans > 10**18:
      print(-1)
      exit()
      
  print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 1
for i in range(n):
  b = int(input())
  ans *= b
if a > 10**18:
   print(-1)
else:
  print(ans)
  



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

if 0 in a:
  print(0)
  
else:
  ans = 1
  for val in a:
    ans *= val
    if ans > 10**18:
      print(-1)
      exit()
      
  print(ans)
Buggy python submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
print((abs(x-a) > abs(x-b)) ? "A" : "B")

Fixed submission:
x, a, b = map(int, input().split())
if abs(x-a) > abs(x-b):
  print("B")
else:
  print("A")
Buggy python submission (verdict: Runtime Error):
s - input()
if s[0] == s[-1]:
  print("Yes")
else:
  print("No")

Fixed submission:
s = input()
if s[0] == s[-1]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split)
print((a + b) % 24)

Fixed submission:
a, b = map(int, input().split())
print((a + b) % 24)
Buggy python submission (verdict: Runtime Error):
rate = int(input())
if rate < 1200:
  print("ABC")
else:
  print("ARC)

Fixed submission:
rate = int(input())
if rate < 1200:
  print("ABC")
else:
  print("ARC")
Buggy python submission (verdict: Runtime Error):
N = input()
if N.isupper():
  print('A')
else:
  print(a)

Fixed submission:
N = input()
if N.isupper():
  print('A')
else:
  print('a')
Buggy python submission (verdict: Runtime Error):
N = int(input())
MM = input().split()
total = 1
for i in MM:
  total = total*int(i)

  if total > 10**18:
    break
for i in MM:
  if int(i) == 0:
    total = 0
if total > 10**18:
  print(-1)
else:
  print(total)
  

Fixed submission:
X,Y = map(int,input().split())
count = 0
for i in range(X+1):
  for j in range(X+1):
    if 2*i + 4*j == Y and i+j ==X:
      count +=1
if count == 0:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
A,V = map(int,input().split())
B,W = map(int,input().split())
N = int(input())
if W > V:
  print('No')
else:
  if abs(A-B) <= N*(V-W):
    print('Yes')
  else:
    print('No)

Fixed submission:
A,V = map(int,input().split())
B,W = map(int,input().split())
N = int(input())
if W > V:
  print('NO')
else:
  if abs(A-B) <= N*(V-W):
    print('YES')
  else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
MM = input().split()
total = 1
for i in MM:
  total = total*int(i)
if total > 10**18:
  print(-1)
else:
  print(total)

Fixed submission:
N = int(input())
MM = input().split()
total = 1
for i in MM:
  total = total*int(i)

  if total > 10**18:
    break
for i in MM:
  if int(i) == 0:
    total = 0
if total > 10**18:
  print(-1)
else:
  print(total)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

MMM = map(int,input().split())
MM =list(MMM)
mini = 2020202020
for i in range(N):
  total1 = 0
  total2 = 0
  for j in range(i+1):
    
    total1 += MM[j]
  for k in range(i+1,N):
    
    total2 += MM[k]
  if abs(total1-total2)< mini:
    mini = abs(total1 -total2)
print(mini)

Fixed submission:
N = int(input())

MMM = map(int,input().split())
MM =list(MMM)
mini = 2020202020
list1 = []
total = 0
for i in MM:
  total+=i
  list1.append(total)
for i in list1:
  x = abs(total - 2*i)
  if mini > x:
    mini = x
print(mini)
Buggy python submission (verdict: Time Limit Exceeded):
MM = input().split()
A = int(MM[0])
B = int(MM[1])
total = 1
count = 0
while total != B:
  total += A-1
  count += 1
print(count)

Fixed submission:
MM = input().split()
A = int(MM[0])
B = int(MM[1])
total = 1
count = 0
while total < B:
  total += A-1
  count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
MM = input().split()
A = int(MM[0])
B = int(MM[1])
list1 =[]
for i in range(A):
  aa = input()
  if '.'*B == aa:
    pass
  else:
    list1.append(list(aa))


for i in range(B):
  count = 0
  for j in range(len(list1)):
    if list1[j][i] == '#':
      count +=1
  if count == 0:
    for j in range(len(list1)):
     
      list1[j][i] = 'a'

for i in list1:
  i.remove('a')

for i in list1:
  for j in i:
    print(j,end='')
  print()

Fixed submission:
MM = input().split()
A = int(MM[0])
B = int(MM[1])
list1 =[]
for i in range(A):
  aa = input()
  if '.'*B == aa:
    pass
  else:
    list1.append(list(aa))


for i in range(B):
  count = 0
  for j in range(len(list1)):
    if list1[j][i] == '#':
      count +=1
  if count == 0:
    for j in range(len(list1)):
     
      list1[j][i] = 'a'

for i in list1:
  if 'a' in i:
    i.remove('a')

for i in list1:
  for j in i:
    if j != 'a':
      print(j,end='')
  print()
Buggy python submission (verdict: Runtime Error):
NN = input()
total = 0
for i in NN:
  a = NN.count(i)
  if a%2 ==0:
    pass
  else:
    totaL +=1
if total ==0:
  print('Yes')
else:
  print('No')
    


Fixed submission:
NN = input()
total = 0
for i in NN:
  a = NN.count(i)
  if a%2 ==0:
    pass
  else:
    total +=1
if total ==0:
  print('Yes')
else:
  print('No')