Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,y=map(int,input().split())
a,b,c=-1,-1,-1
x=y//1000-n
if y%1000==0:
  for i in range(n+1):
    for j in range(n+1-j):
      if x==9*i+4*j:
        a=i
        b=j
        c=n-i-j
        break
    if a!=-1:
      break
print(a,b,c)

Fixed submission:
n,y=map(int,input().split())
a,b,c=-1,-1,-1
x=y//1000-n
if y%1000==0:
  for i in range(n+1):
    for j in range(n+1-i):
      if x==9*i+4*j:
        a=i
        b=j
        c=n-i-j
        break
    if a!=-1:
      break
print(a,b,c)
Buggy python submission (verdict: Runtime Error):
from math import ceil

n,h=map(int,input().split())
a=[]
b=[]
ans=0

for i in range(n):
  aa,bb=map(int,input().split())
  a.append(aa)
  b.append(bb)

b.sort()

pin=max(a)

while True:
  p=b.pop()
  if p<pin:
    break
  ans+=1
  h-=p

ans+=ceil(h/pin)


print(ans)

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

n,h=map(int,input().split())

once=[]
infinity=[]

for i in range(n):
  a,b=map(int,input().split())
  once.append(b)
  infinity.append(a)
  
once.sort(reverse=True)

pin=max(infinity)

once2=[]
for i in range(n):
  if once[i]>pin:
    once2.append(once[i])
  
  else:
      break

ans=0
for i in once2:
    ans+=1
    h-=i
    if h<=0:
        print(ans)
        exit()

ans+=math.ceil(h/pin)


print(ans)

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

n,h=map(int,input().split())
a=[]
b=[]
lst=[]
ans=0

for i in range(n):
  aa,bb=map(int,input().split())
  a.append(aa)
  b.append(bb)
  lst.append([aa,bb])




lst.sort(key=lambda x:max(x[0],x[1]))


guilty=sum(b)
app=max(a)

ans+=ceil((h-guilty)/app)
h-=ans*app

cnt=0

for i in b:
  if i<app:
    cnt+=1

while cnt>0:
  cnt-=1
  ans+=1
  h-=app
  if h<=0:
    print(ans)
    exit()

while True:
  p,q=lst.pop()
  z=max(p,q)
  ans+=1
  h-=z
  if h<=0:
    h+=z
    xxx,yyy=lst.pop()
    h-=yyy
    if h<=0:
      print(ans-1)
      exit()

    else:
      print(ans)
      exit()





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

n,h=map(int,input().split())

once=[]
infinity=[]

for i in range(n):
  a,b=map(int,input().split())
  once.append(b)
  infinity.append(a)
  
once.sort(reverse=True)

pin=max(infinity)

once2=[]
for i in range(n):
  if once[i]>pin:
    once2.append(once[i])
  
  else:
      break

ans=0
for i in once2:
    ans+=1
    h-=i
    if h<=0:
        print(ans)
        exit()

ans+=math.ceil(h/pin)


print(ans)
Buggy python submission (verdict: Runtime Error):
import re
a,b=map(int,input().split())
s=input()
if re.fullmatch('^[0-9]{a}-[0-9]{b}$',s)==True:
  print('Yes')
else:
  print('No')


Fixed submission:
a,b=map(int,input().split())
s=input()
if s[a]=='-' and s.count('-')==1:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
import re
a,b=map(int,input().split())
s=input()
if re.fullmatch(^[0-9]{a}-[0-9]{b}$,s)==True:
  print('Yes')
else:
  print('No')


Fixed submission:
a,b=map(int,input().split())
s=input()
if s[a]=='-' and s.count('-')==1:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
import re
a,b=map(int,input().split())
s=input()
if re.fullmatch([0-9]{a}-[0-9]{b},s)==True:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b=map(int,input().split())
s=input()
if s[a]=='-' and s.count('-')==1:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
def get_prime(n):
    if n<=1:
      return []
    prime=[2]
    limit=int(math.sqrt(n))
    
    data=[i+1 for i in range(2,n,2)]
    while limit>data[0]:
      prime.append(data[0])
      
      data=[j for j in data if j % data[0]!=0]
      
    return prime+data

xx=get_prime(100000)

xxx=[False]*100001

for i in xx:
  xxx[i]=True

xxxx=[False]*100001

for i in xx:
  xxxx[i]=True

for i in range(1,100001):
  if xxx[i]==True:
    if xxxx[(i+1)//2]==False:
      xxx[i]=False

q=int(input())

for i in range(q):
  l,r=map(int,input().split())
  print(sum(xxx[:r+1])-sum(xxx[:l]))


Fixed submission:
import math
import itertools

def get_prime(n):
    if n<=1:
      return []
    prime=[2]
    limit=int(math.sqrt(n))
    
    data=[i+1 for i in range(2,n,2)]
    while limit>data[0]:
      prime.append(data[0])
      
      data=[j for j in data if j % data[0]!=0]
      
    return prime+data

xx=get_prime(100000)

xxx=[False]*100001

for i in xx:
  xxx[i]=True

xxxx=[False]*100001

for i in xx:
  xxxx[i]=True

for i in range(1,100001):
  if xxx[i]==True:
    if xxxx[(i+1)//2]==False:
      xxx[i]=False

q=int(input())

for i in range(100001):
  if xxx[i]==True:
    xxx[i]=1
  else:
    xxx[i]=0
    
xxx=list(itertools.accumulate(xxx))
    

for i in range(q):
  l,r=map(int,input().split())
  print(xxx[r]-xxx[l-1])
Buggy python submission (verdict: Runtime Error):
import math
print(math.ceil((a+b)/2))

Fixed submission:
a,b=map(int,input().split())
import math
print(math.ceil((a+b)/2))
Buggy python submission (verdict: Runtime Error):
s=list(input())
t=list(input())
s.sort()
t.sort()
if s==t and s.count(s[0])==len(s) and t.count(s[0])==len(t):
  print('No')
  elif s.count(s[0])==len(s) and t.count(s[0])==len(t):
    if len(s)<len(t):
      print('Yes')
    else:
      print('No')
  else:
    if ord(s[0])==ord(t[-1]):
      print('No')
    elif ord(s[0])<ord(t[-1]):
      print('Yes')
    else:
      print('No')

Fixed submission:
s=list(input())
t=list(input())
s.sort()
t.sort()
if s==t and s.count(s[0])==len(s) and t.count(s[0])==len(t):
    print('No')
elif s.count(s[0])==len(s) and t.count(s[0])==len(t):
    if len(s)<len(t):
      print('Yes')
    else:
      print('No')
else:
    if ord(s[0])==ord(t[-1]):
      print('No')
    elif ord(s[0])<ord(t[-1]):
      print('Yes')
    else:
      print('No')

Buggy python submission (verdict: Runtime Error):
s=list(input())
t=list(input())
s.sort()
t.sort()
for i in range(min(len(s),len(t))):
  if s[-1*(i+1)]==t[-1*(i+1)]:
    x=1
    continue
  elif ord(s[-1*(i+1)])>ord(t[-1*(i+1)]):
    print('No')
    x=0
    break
  else:
    x=0
    print('Yes')
    break
if x=1:
  if len(s)<len(t):
    print('Yes')
  else:
    print('No')

Fixed submission:
s=list(input())
t=list(input())
s.sort()
t.sort()
if s==t and s.count(s[0])==len(s) and t.count(s[0])==len(t):
    print('No')
elif s.count(s[0])==len(s) and t.count(s[0])==len(t):
    if len(s)<len(t):
      print('Yes')
    else:
      print('No')
else:
    if ord(s[0])==ord(t[-1]):
      print('No')
    elif ord(s[0])<ord(t[-1]):
      print('Yes')
    else:
      print('No')
Buggy python submission (verdict: Runtime Error):
s=input()
print(s.count(1))

Fixed submission:
s=input()
print(s.count('1'))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=30
for i in a:
  x=0
  while True:
    if i%2==1:
      break
    else:
    x+=1
    i=i//2
    continue
  ans=min(ans,x)
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=30
for i in a:
  x=0
  while True:
    if i%2==1:
      break
    else:
      x+=1
      i=i//2
      continue
  ans=min(ans,x)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(set(a))
x=len(b)-k
b=list(map(lambda x:a.count(x),b))
b.sort()
if x<=0:
  print(0)
else:
  print(sum(b[:x]))

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
n=[0]*200000
x=[]
for i in a:
    n[i-1]+=1
for i in n:
    if i!=0:
        x+=[i]
y=len(x)
z=y-k
if z<=0:
    print(0)
else:
    x.sort()
    print(sum(x[:z]))
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=str(n)
x=0
for i in m:
  x+=i
if n%x==0:
  print('Yes')
else:
  print('No')


Fixed submission:
n=int(input())
m=str(n)
x=0
for i in m:
  x+=int(i)
if n%x==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n=input()
x=0
for i in n:
  x+=i
if int(n)%x==0:
  print('Yes')
else:
  print('No')

Fixed submission:
n=int(input())
m=str(n)
x=0
for i in m:
  x+=int(i)
if n%x==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import itertools
x=list(input())

for lst in itertools.product(['+','-'],repeat=3)
  sum=int(x[0])
  for i in range(3):
    if lst[i]=='+':
      sum+=int(x[i+1])
    else:
      sum-=int(x[i+1])
  if sum==7:
    print(x[0]+lst[0]+x[1]+lst[1]+x[2]+lst[2]+x[3]+'=7')
    break

Fixed submission:
a=list(input())
for i in range(4):
  a[i]=int(a[i])
x=sum(a)-7
dict={0:'+',1:'-'}
ans=0
for i in range(2):
  for j in range(2):
    for k in range(2):
        if x==(i*a[1]+j*a[2]+k*a[3])*2:
          print(a[0],dict[i],a[1],dict[j],a[2],dict[k],a[3],'=7',sep='')
          ans=1
        if ans==1:
          break
    if ans==1:
      break
  if ans==1:
    break
Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(1,40000):
  if i*i>n:
  　print(i-1)
    break


Fixed submission:
n=int(input())
for i in range(1,40000):
  if i**2>n:
    print((i-1)**2)
    break
Buggy python submission (verdict: Runtime Error):
n=int(input())
n=3**n
a=list(map(int,input().split()))

a=[2 if i%2==0 for i in a else 1]

cnt=1

for i in a:
  cnt*=i
  
  
print(n-cnt)


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

a=[2 if i%2==0 else 1 for i in a]

cnt=1

for i in a:
  cnt*=i
  
  
print(n-cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())

dot=[]
xxx=[]
yyy=[]

ans=float('inf')

for i in range(n):
  x,y=map(int,input().split())
  dot.append([x,y])
  xxx.append(x)
  yyy.append(y)

for sx in xxx:
  for sy in yyy:
    for gx in xxx:
      for gy in yyy:
        if sx==gx or sy==gy:
          continue
        cnt=0
        for lst in dot:
          if sx<=lst[0]<=gx or gx<=lst[0]<=sx:
            if sy<=lst[1]<=gy or gy<=lst[1]<=sy:
              cnt+=1
      
        if cnt>=k:
          ans=min(ans,abs(sx-gx)*abs(sy-gy))


print(ans)

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

dot=[]
xxx=[]
yyy=[]

ans=float('inf')

for i in range(n):
  x,y=map(int,input().split())
  dot.append([x,y])
  xxx.append(x)
  yyy.append(y)

xxx.sort()
yyy.sort()

for sx in range(n):
  for sy in range(n):
    for gx in range(sx+1,n):
      for gy in range(sy+1,n):
        cnt=0
        for lst in dot:
          if xxx[sx]<=lst[0]<=xxx[gx]:
            if yyy[sy]<=lst[1]<=yyy[gy]:
              cnt+=1
      
        if cnt>=k:
          if xxx[sx]==xxx[gx] or yyy[sy]==yyy[gy]:
            continue
          ans=min(ans,(xxx[gx]-xxx[sx])*(yyy[gy]-yyy[sy]))


print(ans)
Buggy python submission (verdict: Runtime Error):
import collections
n=int(input())
lst=[int(input()) for i in range(n)]
xs=list(set(lst))
ans=0
lst=collections.Counter(lst)
for i in xs:
  if lst[i]%=1:
    ans+=1

print(ans)

Fixed submission:
import collections
n=int(input())
lst=[int(input()) for i in range(n)]
xs=list(set(lst))
ans=0
lst=collections.Counter(lst)
for i in xs:
  if lst[i]%2==1:
    ans+=1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
b=set(a)
ans=0
for i in b:
  if a.count(i)%2==1:
    ans+=1
print(ans)

Fixed submission:
import collections
n=int(input())
lst=[int(input()) for i in range(n)]
xs=list(set(lst))
ans=0
lst=collections.Counter(lst)
for i in xs:
  if lst[i]%2==1:
    ans+=1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
b=set(a)
ans=0
for i in b:
  if a.count(i)%2==1:
    ans+=1
print(ans)

Fixed submission:
import collections
n=int(input())
lst=[int(input()) for i in range(n)]
xs=list(set(lst))
ans=0
lst=collections.Counter(lst)
for i in xs:
  if lst[i]%2==1:
    ans+=1

print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=set(a)
ans=0
for i in b:
  a.count(i)%2==1:
    ans+=1
print(ans)

Fixed submission:
import collections
n=int(input())
lst=[int(input()) for i in range(n)]
xs=list(set(lst))
ans=0
lst=collections.Counter(lst)
for i in xs:
  if lst[i]%2==1:
    ans+=1

print(ans)
Buggy python submission (verdict: Runtime Error):
print(max((int(input())-int(input())),0))

Fixed submission:
x,t=map(int,input().split())
print(max(x-t,0))

Buggy python submission (verdict: Runtime Error):
print(int(input())-int(input()))

Fixed submission:
x,t=map(int,input().split())
print(max(x-t,0))
Buggy python submission (verdict: Runtime Error):
n=input()
if n(0)==n(2):
  print('Yes')
else:
  print('No')

Fixed submission:
n=input()
if n[0]==n[2]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a,b,c=0,0,0
ans='No'
for i in a:
  if a%4==0:
    a+=1
  elif a%2==0:
    b+=1
  else:
    c+=1
if n%2==1:
  if c-a==1:
    if b==0:
      ans='Yes'
  elif a>=c:
    ans='Yes'
else:
  if a>=c:
    ans='Yes'
print(ans)

Fixed submission:
n=int(input())
x=list(map(int,input().split()))
a,b,c=0,0,0
ans='No'
for i in x:
  if i%4==0:
    a+=1
  elif i%2==0:
    b+=1
  else:
    c+=1
if n%2==1:
  if c-a==1:
    if b==0:
      ans='Yes'
  elif a>=c:
    ans='Yes'
else:
  if a>=c:
    ans='Yes'
print(ans)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
n=int(input())
lst=[]

for i in range(1,n+1):
  for j in range(i):
    lst.append(str(i))
    
ans=[[0]*w for i in range(h)]

for i in range(h):
  if i%2==0:
    for j in range(w):
      ans[i][j]=lst.pop()

  else:
    for j in range(w-1,-1,-1):
      ans[i][j]=lst.pop()

for i in ans:
  print(' '.join(i))

Fixed submission:
h,w=map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
lst=[]


for i in range(1,n+1):
  for j in range(a[i-1]):
    lst.append(str(i))

lst.reverse()
    
ans=[[0]*w for i in range(h)]

for i in range(h):
  if i%2==0:
    for j in range(w):
      ans[i][j]=lst.pop()

  else:
    for j in range(w-1,-1,-1):
      ans[i][j]=lst.pop()

for i in ans:
  print(' '.join(i))
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
x=[]
y=[]
for i in lst:
  if i[0]==1:
    x+=[i[1]]
for i in lst:
  if i[1]==n:
    y+=[i[0]]
ans='IMPOSSIBLE'
for i in x:
  if i in y:
    ans='POSSIBLE'
    break
print(ans)


Fixed submission:
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]

x=[]
y=[]

for i in lst:
  if i[0]==1:
    x+=[i[1]]
    
for i in lst:
  if i[1]==n:
    y+=[i[0]]
    
ans='POSSIBLE'

if len(list(set(x)))+len(list(set(y)))==len(list(set(x+y))):
  ans='IMPOSSIBLE'
    
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
x=[]
y=[]
for i in lst:
  if lst[0]==1:
    x+=[i[1]]
for i in lst:
  if lst[1]==n:
    y+=[i[0]]
ans='IMPOSSIBLE'
for i in x:
  if i in y:
    ans='POSSIBLE'
    break
print(ans)


Fixed submission:
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]

x=[]
y=[]

for i in lst:
  if i[0]==1:
    x+=[i[1]]
    
for i in lst:
  if i[1]==n:
    y+=[i[0]]
    
ans='POSSIBLE'

if len(list(set(x)))+len(list(set(y)))==len(list(set(x+y))):
  ans='IMPOSSIBLE'
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
x=[]
y=[]
for i in lst:
  if i[0]==1:
    x+=[i[1]]
for i in lst:
  if i[1]==n:
    y+=[i[0]]
ans='IMPOSSIBLE'
for i in x:
  if i in y:
    ans='POSSIBLE'
    break
print(ans)


Fixed submission:
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]

x=[]
y=[]

for i in lst:
  if i[0]==1:
    x+=[i[1]]
    
for i in lst:
  if i[1]==n:
    y+=[i[0]]
    
ans='POSSIBLE'

if len(list(set(x)))+len(list(set(y)))==len(list(set(x+y))):
  ans='IMPOSSIBLE'
    
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
x=[]
y=[]
for i in lst:
  if lst[0]==1:
    x+=[i[1]]
for i in lst:
  if lst[1]==n:
    y+=[i[0]]
ans='IMPOSSIBLE'
for i in x:
  if i in y:
    ans='POSSIBLE'
    break
print(ans)

Fixed submission:
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]

x=[]
y=[]

for i in lst:
  if i[0]==1:
    x+=[i[1]]
    
for i in lst:
  if i[1]==n:
    y+=[i[0]]
    
ans='POSSIBLE'

if len(list(set(x)))+len(list(set(y)))==len(list(set(x+y))):
  ans='IMPOSSIBLE'
    
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
x=[]
y=[]
for i in lst:
  if lst[0]==1:
    x+=[lst[1]]
for i in lst:
  if lst[1]==n:
    y+=[lst[0]]
ans='IMPOSSIBLE'
for i in x:
  if i in y:
    ans='POSSIBLE'
    break
print(ans)

Fixed submission:
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]

x=[]
y=[]

for i in lst:
  if i[0]==1:
    x+=[i[1]]
    
for i in lst:
  if i[1]==n:
    y+=[i[0]]
    
ans='POSSIBLE'

if len(list(set(x)))+len(list(set(y)))==len(list(set(x+y))):
  ans='IMPOSSIBLE'
    
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
s=s.replace(s[-1],'')
while True:
    s=s.replace(s[-1],'')
    if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]:
      print(len(s))
      break


Fixed submission:
s=input()
s=s[:-1]
while True:
  if len(s)%2==0 and s[len(s)//2:]==s[:len(s)//2]:
    print(len(s))
    break
  else:
    s=s[:-1]
    continue
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in a:
  b.append(i)
  b.reverse()
print(' '.join(b))

Fixed submission:
n=int(input())
a=list(input().split())
if n%2==0:  
  b=a[::2]
  a.pop(0)
  c=a[::2]
  c.reverse()
  print(' '.join(c+b))
else:
  b=a[::2]
  a.pop(0)
  c=a[::2]
  b.reverse()
  print(' '.join(b+c))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
x=1
cnt=0
while True:
    x=a[x-1]
    cnt+=1
    if x==2:
        print(cnt)
        break
    elif x==1:
        print('-1')
        break
    else:
        continue


Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
x=1
cnt=0
y=[1]
while True:
    x=a[x-1]
    cnt+=1
    y.append(x)
    if x==2:
        print(cnt)
        break
    elif x==1:
        print('-1')
        break
    elif cnt==100000:
        print(-1)
        break
    else:
        continue

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
x=1
cnt=0
while True:
    x=a[x-1]
    cnt+=1
    if x==2:
        print(cnt)
        break
    elif x==1:
        print('-1')
        break
    else:
        continue


Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
x=1
cnt=0
y=[1]
while True:
    x=a[x-1]
    cnt+=1
    y.append(x)
    if x==2:
        print(cnt)
        break
    elif x==1:
        print('-1')
        break
    elif cnt==100000:
        print(-1)
        break
    else:
        continue
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
mod=10**9+7
def kaijou(x):
  y=1
  for i in range(1,x+1):
    y*=i
  return y
if abs(n-m)>=2:
  print(0)
elif n==m:
  print(kaijou(n)*kaijou(m)*2)
else:
  print(kaijou(n)*kaijou(m))

Fixed submission:
n,m=map(int,input().split())
mod=10**9+7
def kaijou(x):
  y=1
  for i in range(1,x+1):
    y*=i
    y%=mod
  return y
if abs(n-m)>=2:
  print(0)
elif n==m:
  print((kaijou(n)*kaijou(m)*2)%mod)
else:
  print((kaijou(n)*kaijou(m))%mod)
Buggy python submission (verdict: Runtime Error):
r,g,b=map(int.input().split())
if ((g*10+b)%4)==0:
  print('YES')
else:
  print('NO')


Fixed submission:
r,g,b=map(int,input().split())
if ((g*10+b)%4)==0:
  print('YES')
else:
  print('NO')

Buggy python submission (verdict: Runtime Error):
r,g,b=map(int.input().split())
if (g*10+b)%4==0:
  print('YES')
else:
  print('NO')

Fixed submission:
r,g,b=map(int,input().split())
if ((g*10+b)%4)==0:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split()
list=[4,6,9,11]
if a==2 or b==2:
  print('No')
elif a in list and b in list:
  print('Yes')
elif a not in list and b not in list:
  print('Yes')
else:
  print('No')


Fixed submission:
a,b=map(int,input().split())
list=[4,6,9,11]
if a==2 or b==2:
  print('No')
elif a in list and b in list:
  print('Yes')
elif a not in list and b not in list:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split()
if a==2 or b==2:
  print('No')
list=[4,6,9,11]
elif a in list and b in list:
  print('Yes')
elif a not in list and b not in list:
  print('Yes')
else:
  print('No')

Fixed submission:
a,b=map(int,input().split())
list=[4,6,9,11]
if a==2 or b==2:
  print('No')
elif a in list and b in list:
  print('Yes')
elif a not in list and b not in list:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
s=''
ans=1
for i in range(n-1):
  if a[i]<a[i+1]:
    s+='x'
  elif a[i]>a[i+1]:
    s+='y'
for i in range(len(s)):
  if s[i]!=s[i+1]:
    ans+=1
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
x=[]
ans=1

for i in range(n-1):
  if a[i+1]==a[i]:
    continue
  x.append(a[i+1]-a[i])
  
flag=True

for i in range(len(x)-1):
  if flag==False:
    flag=True
    continue
  if x[i]<0 and x[i+1]>0 or x[i]>0 and x[i+1]<0:
    ans+=1
    flag=False
    

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(pow(n*2,0.5)//1+1,0,-1):
  if i*(i-1)<2*n:
    continue
  else:
    print(i+1)
    break

Fixed submission:
x=int(input())
ans=0
i=1
cnt=0
while x>ans:
  ans+=i
  i+=1
  cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(pow(n*2,0.5)//1+1,0,-1):
  if i*(i-1)<2*n:
    continue
  else:
    print(i+1)

Fixed submission:
x=int(input())
ans=0
i=1
cnt=0
while x>ans:
  ans+=i
  i+=1
  cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
mod=10**9+7
n=int(input())
a=1
for i in range(1,n+1):
  a*=i
print(a%mod)

Fixed submission:
mod=10**9+7
n=int(input())
a=1
for i in range(1,n+1):
  a*=i
  a%=mod
print(a)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input.split())
if a==b:
  print('Draw')
elif a==1:
  print('Alice')
elif b==1:
  print('Bob')
elif a>b:
  print('Alice')
elif a<b:
  print('Bob')


Fixed submission:
a,b=map(int,input().split())
if a==b:
  print('Draw')
elif a==1:
  print('Alice')
elif b==1:
  print('Bob')
elif a>b:
  print('Alice')
elif a<b:
  print('Bob')

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input.split())
if a==b:
  print('Draw')
elif a==1:
  print('Alice')
elif b==1:
  print('Bob')
elif a>b:
  print('Alice')
else:
  print('Bob')

Fixed submission:
a,b=map(int,input().split())
if a==b:
  print('Draw')
elif a==1:
  print('Alice')
elif b==1:
  print('Bob')
elif a>b:
  print('Alice')
elif a<b:
  print('Bob')
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=[[input()] for i in range(n)]
y=[[input()] for i in range(m)]

for i in range(n-m+1):
  for j in range(n-m+1):
    if x[i][j]==y[0][0]:
      if m==1:
        print('Yes')
        exit()
      for k in range(m):
        if x[i+k][j:j+n-m+1]!=y[k]:
          continue
          
        print('Yes')
        exit()
        
print('No')

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

x=[input() for i in range(n)]
y=[input() for i in range(m)]

ans='No'

for i in range(n-m+1):
  for j in range(n-m+1):
    maze=[]
    for k in range(m):
      pin=''
      for l in range(m):
        pin+=x[i+k][j+l]
      
      maze.append(pin)

    if maze==y:
      ans='Yes'
      break


print(ans)