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

init_w, init_h, init_w2, init_h2 = 0,0,w,h
for i in range(n):
  x, y, a = list(map(int,input().split()))
  
  if a ==1:
    init_w = x
  elif a==2:
    init_w2 = x
  elif a==3:
    init_h = y
  elif a==4:
    init_h2 = y

area = (init_w2-init_w)*(init_h2-init_h)
if area<=0:
  area = 0
print(area)




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

if c==b+a:
  print("Yes")
  
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
number = int(input().split())
if (number[1] * 10 + number [2]) % 4 == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
number = input().split()
number = [int(i) for i in number]
if (number[1] * 10 + number [2]) % 4 == 0:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
number = int(input().split())
if (number[1] * 10 + number [2]) % 4 == 0:
    print(YES)
else:
    print(NO)


Fixed submission:
number = input().split()
number = [int(i) for i in number]
if (number[1] * 10 + number [2]) % 4 == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
houseTime = int(input())
place = input().split() 
place = int(i) for i in place
place = sorted(place)
print(place[houseTime - 1] - place[0])


Fixed submission:
houseTime = int(input())
place = input().split() 
place = [int(i) for i in place]
place = sorted(place)
print(place[houseTime - 1] - place[0])
Buggy python submission (verdict: Runtime Error):
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in memLate:
    if color // 400 >= 8:
        highLate += 1
    elif color // 400 in colorList == False
        colorList += color // 400
maxColor = len(colorList) + highLate
if maxColor > 7:
    maxColor = 7
print(str(len(colorList)) + " " + str(maxColor))

        

Fixed submission:
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in range(memTime):
    member = memLate[color]
    if member // 400 >= 8:
        highLate += 1
    elif ((member // 400) in colorList) == False:
        colorList.append(member // 400)
maxColor = len(colorList) + highLate
minColor = len(colorList)
if minColor == 0:
    minColor = 1
print(str(minColor) + " " + str(maxColor))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a=set(a)
print(len(a))


Fixed submission:
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=input()
  
a=set(a)
print(len(a))
Buggy python submission (verdict: Time Limit Exceeded):
s=str(input())
n=len(s)
ans=0
for i in range(3,n):
  for j in range(i-2):
    if int(s[j:i+1])%2019==0:
      ans+=1
print(ans)


Fixed submission:
s=input()
s=s[::-1]
n=len(s)
count=[0]*2019
count[0]=1
num,d=0,1

for i in s:
  num+=int(i)*d
  num%=2019
  d*=10
  d%=2019
  count[num]+=1

ans=0
for i in count:
  ans+=i*(i-1)//2
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

  
for i in range(n):
  print(a.count(i+1))




Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=[0]*n
for i in range(n-1):
  t=a[i]
  c[t-1]+=1
  
for i in range(n):
  print(c[i])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
c=[0]*n
for i in range(n-1):
  c[i]=a.count(i+1)
  
for i in range(n):
  print(c[i])




Fixed submission:
n=int(input())
a=list(map(int,input().split()))
c=[0]*n
for i in range(n-1):
  t=a[i]
  c[t-1]+=1
  
for i in range(n):
  print(c[i])
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=[0]*n
for i in range(k,n+2):
  a[i-k]=n*i-i**2+i+1

print(sum(a)%(10**9+7))




Fixed submission:
n,k=map(int,input().split())
a=[0]*(n+1)
for i in range(k,n+2):
  a[i-k]=(n*i-i**2+i+1)%(10**9+7)

print(sum(a)%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
import math
k=int(input())
k+=1
d=0
for i in range(1,k):
  for j in range(1,k):
    for l in range(1,k):
      d+=math.gcd(math.gcd(i,j),l)
      
print(d)


Fixed submission:
import math

K = int(input())

ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        x = math.gcd(i, j)
        for k in range(1, K+1):
            ans += math.gcd(x, k)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
import math
ans=0
for i in range(1,k+1):
	
        for j in range(1,k+1):
		
                for l in range(1,k+1):
			
                        ans+=math.gcd(i,math.gcd(j,l))
print(ans)


Fixed submission:
import math

K = int(input())

ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        x = math.gcd(i, j)
        for k in range(1, K+1):
            ans += math.gcd(x, k)

print(ans)

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
ans=0
for i in range(1,k+1):
	
        for j in range(1,k+1):
		
                for l in range(1,k+1):
			
                        ans+=math.gcd(i,math.gcd(j,l))

print(ans)

Fixed submission:
import math

K = int(input())

ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        x = math.gcd(i, j)
        for k in range(1, K+1):
            ans += math.gcd(x, k)

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

if a<b:
    a,b=b,a

if a%b == 0:
    print(0)
else:
    
    a=a%b
    
    while abs(a-b)<a:
        a=abs(a-b)
    print(a)


Fixed submission:
a,b,c = map(int,input().split())
a,b = b,a
a,c = c,a
print("{} {} {}".format(a,b,c))
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())

if a<b:
    a,b=b,a

if a%b == 0:
    print(0)
else:
    c=a//b
    d=a%b
    a=a-b*c
    while abs(a-b)<a:
        a=abs(a-b)
    print(a)

Fixed submission:
n,k=map(int,input().split())
print(min(n%k,abs(n%k-k)))

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

if a<b:
    a,b=b,a

if a%b == 0:
    print(0)

else:
    c=list(divmod(a,b))
    while a%b != 0 and abs(b-c[1])<c[1]:
        a=b
        b=c[1]
        c=list(divmod(a,b))

    print(c[1])

Fixed submission:
n,k=map(int,input().split())
print(min(n%k,abs(n%k-k)))
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=n//500
e=n%500
f=e//5
print('d*1000 + f*5)


Fixed submission:
n=int(input())
d=n//500
e=n%500
f=e//5
print(d*1000+f*5)
Buggy python submission (verdict: Runtime Error):
k,n=map(int,input().split())
A=list(map(int,input().split()))
d=[0]*len(A)
for i in range(len(A)):
  if i==0:
    d[i]=A[len(A)]-A[i]
  else:
    d[i]=k-A[i] + A[i-1]
    
print(min(A))


Fixed submission:
k,n=map(int,input().split())
A=list(map(int,input().split()))
d=[0]*n
d[0]=A[n-1]-A[0]
for i in range(1,n):
  d[i]=k-A[i] + A[i-1]
    
print(min(d))
Buggy python submission (verdict: Runtime Error):
l=list(input())
def kaibun(c):
  d=c[::-1]
  if c = d:
    return 0
  else:
    return 1
a=kaibun(l)
m=l[:int((len(l)-1)/2)]
n=l[int((len(l)+1)/2):]

b=kaibun(m)
c=kaibun(n)

if a+b+c==0:
  print('Yes')
else:
  print('No')
 

Fixed submission:
l=list(input())
def kaibun(c):
  d=c[::-1]
  if c == d:
    return 0
  else:
    return 1
a=kaibun(l)
m=l[:int((len(l)-1)/2)]
n=l[int((len(l)+1)/2):]

b=kaibun(m)
c=kaibun(n)

if a+b+c==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s=int(input())
if s[0] == s[1] and s[1] == s[2] and s[0] == s[2]:
  print('No')
else:
  print('Yes')


Fixed submission:
s=str(input())
if s[0] == s[1] and s[1] == s[2] and s[0] == s[2]:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
if n==1:
  for i in range(10):
    
    flg=True
    for l in range(m):
      if str(i)[b[l][0]-1]  != str(b[l][1]):
        flg=False
    if flg==True:
      print(i)
      break
  else:
    print(-1)
  
else:  
  for i in range(10**(n-1),10**n):
    flg=True
    for j in range(m):
      if str(i)[b[j][0]-1] != str(b[j][1]):
        flg=False
    
    if flg==True:
      print(i)
      break
  if flg == False:
    print(-1)
      

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

b=[list(map(int,input().split())) for i in range(m)]

if n==1:
  for i in range(10):
    
    flg=True
    for l in range(m):
      if str(i)[b[l][0]-1]  != str(b[l][1]):
        flg=False
    if flg==True:
      print(i)
      break
  else:
    print(-1)
  
else:  
  for i in range(10**(n-1),10**n):
    flg=True
    for j in range(m):
      if str(i)[b[j][0]-1] != str(b[j][1]):
        flg=False
    
    if flg==True:
      print(i)
      break
  if flg == False:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
f=False
for i in range(n):
  if x[i]%2==0:
    if x%3==0 or x%5==0:
      pass
    else:
      f=True
      break
      
if f==False:
  print('APPROVED")
else:
        print('DENIED')


Fixed submission:
n=int(input())
x=list(map(int,input().split()))
f=False
for i in range(n):
  if x[i]%2==0:
    if x[i]%3==0 or x[i]%5==0:
      pass
    else:
      f=True
      break
      
if f==False:
  
  print('APPROVED')
else:
        print('DENIED')
Buggy python submission (verdict: Runtime Error):
s=input()
l=len(s)
t=[]
for i in range(l):
  t.append(x)

n=''.join(t)
print(n)


Fixed submission:
s=input()
l=len(s)
t=[]
for i in range(l):
  t.append('x')

n=''.join(t)
print(n)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
h=h[::-1]
if k!=0:
  for i in range(k):
    h[i]=0

  
print(sum(h))




Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
h=h[::-1]

if k>=n:
  print(0)
  
elif k!=0:
  for i in range(k):
    h[i]=0
  print(sum(h))

else:
  print(sum(h))

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
h=[::-1]
if k!=0:
  for i in range(k):
    h[i]=0

  
print(sum(h))


Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
h=h[::-1]

if k>=n:
  print(0)
  
elif k!=0:
  for i in range(k):
    h[i]=0
  print(sum(h))

else:
  print(sum(h))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=list(map(int,input().split()))
count=1
for i in range(1,n):
  if min(p[i],min(p[:i])) == p[i]:
    count+=1
print(count)



Fixed submission:
n=int(input())
p=list(map(int,input().split()))
count=0
q=100000000
for i in range(n):
  if min(p[i],q) == p[i]:
    count+=1
    q=p[i]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  p=[list(map(str,input().split())) for i in range(m)]
  q=[]
  s=[0]*n
  t=0
  for i in range(m):
    if p[i][1]=='AC' and  not p[i][0] in q:
      q.append(p[i][0])
      
      t+=s[int(p[i][0])-1]
      
      
    elif p[i][1]=="WA":
      if not p[i][0] in q:
        s[int(p[i][0])-1]+=1
        
  
  
  
  
  print(len(q),t)
  

Fixed submission:
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  q=[0]*(n+1)
  s=[0]*(n+1)
  t=0
  for i in range(m):
    p,u=map(str,input().split())
    p=int(p)
    if q[p]==1:
      continue
    
    elif u=='AC':
      q[p]=1
      
      t+=s[p]
      
      
    elif u=="WA":
      if q[p]==0:
        s[p]+=1
        
  
  
  
  
  print(sum(q),t)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  p=[list(map(str,input().split())) for i in range(m)]
  q=[]
  s=[0]*n
  t=0
  for i in range(len(p)):
    if p[i][1]=='AC' and  not p[i][0] in q:
      q.append(p[i][0])
      t+=s[i]
      
    elif p[i][1]=="WA":
      if not p[i][0] in q:
        s[i]+=1
  
  
  
  
  print(len(q),t)
  

Fixed submission:
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  q=[0]*(n+1)
  s=[0]*(n+1)
  t=0
  for i in range(m):
    p,u=map(str,input().split())
    p=int(p)
    if q[p]==1:
      continue
    
    elif u=='AC':
      q[p]=1
      
      t+=s[p]
      
      
    elif u=="WA":
      if q[p]==0:
        s[p]+=1
        
  
  
  
  
  print(sum(q),t)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  p=[list(map(str,input().split())) for i in range(m)]
  q=[]
  s=[0]*n
  t=0
  for i in range(len(p)):
    if p[i][1]=='AC' and  not p[i][0] in q:
      q.append(p[i][0])
      t+=s
      
    elif p[i][1]=="WA":
      if not p[i][0] in q:
        s[i]+=1
  
  
  
  
  print(len(q),t)
  

Fixed submission:
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  q=[0]*(n+1)
  s=[0]*(n+1)
  t=0
  for i in range(m):
    p,u=map(str,input().split())
    p=int(p)
    if q[p]==1:
      continue
    
    elif u=='AC':
      q[p]=1
      
      t+=s[p]
      
      
    elif u=="WA":
      if q[p]==0:
        s[p]+=1
        
  
  
  
  
  print(sum(q),t)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  p=[list(map(str,input().split())) for i in range(m)]
  q=[]
  s=[0]*n
  t=0
  for i in range(len(p)):
    if p[i][1]=='AC' and  not p[i][0] in q:
      q.append(p[i][0])
      t+=s
      
    elif p[i][1]=="WA":
      if not p[i][0] in q:
        s[i]+=1
  
  
  
  
  print(len(q),len(s))
  

Fixed submission:
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  q=[0]*(n+1)
  s=[0]*(n+1)
  t=0
  for i in range(m):
    p,u=map(str,input().split())
    p=int(p)
    if q[p]==1:
      continue
    
    elif u=='AC':
      q[p]=1
      
      t+=s[p]
      
      
    elif u=="WA":
      if q[p]==0:
        s[p]+=1
        
  
  
  
  
  print(sum(q),t)
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,innput().split())
if a>=k:
  print(a-k,b)
elif a+b>=k:
  print(0,b-(k-a))
else:
  print(0,0)


Fixed submission:
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a+b>=k:
  print(0,b-(k-a))
else:
  print(0,0)

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,innput().split())
if a>=k:
  print(a-k,b)
else:
  print(0,b-(k-a))


Fixed submission:
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a+b>=k:
  print(0,b-(k-a))
else:
  print(0,0)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
import math
c=a*b//math.gcd(a,b)
print(c)


Fixed submission:
a,b=map(int,input().split())
import fractions
def lcm(a,b):
  return a*b//fractions.gcd(a,b)
print(lcm(a,b))
Buggy python submission (verdict: Runtime Error):
n=int(input(n))
t=False

for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      t=True
      break
if t:
  print('Yes')
else:
  print('No')


Fixed submission:
n=int(input())
t=False

for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      t=True
      break
if t:
  print('Yes')
else:
  print('No')

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

for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      t=True
      break
if t:
  print('Yes')
else:
  print('No')


Fixed submission:
n=int(input())
t=False

for i in range(1,10):
  for j in range(1,10):
    if i*j==n:
      t=True
      break
if t:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n-2):
  a=l[i]
  
  for j in range(i+1,n-1):
    b=l[j]
    k=j
    while k<n and l[k]<a+b:
      k+=1
    ans+=k-j-1
print(ans)




Fixed submission:
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n-2):
  a=l[i]
  k=i
  for j in range(i+1,n-1):
    b=l[j]
    
    while k<n and l[k]<a+b:
      k+=1
    ans+=k-j-1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

def fact(n):
  temp=n
  arr=[]
  for i in range(2,int(-(-n**0.5//1))+1):
    if temp%i==0:
      
      while temp%i==0:
        
        temp//=i
      arr.append(i)
      
  if temp!=1:
    arr.append(temp)
  if arr==[]:
    arr.append(n)
  return arr

c=fact(a)
d=fact(b)


  
for i in range(len(c)):
  if c[i] not in d:
    del c[i]

    
print(len(c)+1)

    

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

def fact(n):
  temp=n
  arr=[]
  for i in range(2,int(-(-n**0.5//1))+1):
    if temp%i==0:
      
      while temp%i==0:
        
        temp//=i
      arr.append(i)
      
  if temp!=1:
    arr.append(temp)
  if arr==[]:
    arr.append(n)
  return arr

c=fact(a)
d=fact(b)
e=[1]

  
for i in range(len(c)):
  if c[i]  in d:
    e.append(c[i])

e=set(e)    
print(len(e))
Buggy python submission (verdict: Runtime Error):
n,q=map(int,input().split())
g=[[] for i in range(n)]

for i in range(n-1):
  a,b=map(int,input().split())
  g[a-1].append(b-1)
  g[b-1].append(a-1)
  
add=[0]*n

for i in range(q):
  p,x=map(int,input().split())
  add[p-1]+=x
  
ans=[0]*n
def dfs(v,p,value):
  value+=add[v]
  ans[v]=value
  for j in g[v]: 
    if j==p: continue
    dfs(j,v,value)
      
      
dfs(0,-1,0)

print(*ans)




Fixed submission:
import collections

n,q=map(int,input().split())
cnt=[0]*(n+1)
g=[[] for i in range(n+1)]
for i in range(n-1):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
for i in range(q):
  v,val=map(int,input().split())
  cnt[v]+=val
q=collections.deque()
q.append(1)
checked=[0]*(n+1)
while q:
  v=q.pop()
  checked[v]=1
  for i in g[v]:
    if checked[i]==1:
      continue
    cnt[i]+=cnt[v]
    q.append(i)
print(*cnt[1:])
Buggy python submission (verdict: Runtime Error):
m=int(input())
ans=0
for i in range(n+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)



Fixed submission:
m=int(input())
ans=0
for i in range(1,m+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
n=len(s)
dp=[[0]*13 for i in range(n+1)]
dp[0][0]=1
mod=10**9+7

for i in range(n):
  if s[i]=="?":
    for j in range(10):
      for k in range(13):
        dp[i+1][(k*10+j)%13]+=dp[i][k]%mod
  else:
    for k in range(13):
      dp[i+1][(k*10+int(s[i]))%13]+=dp[i][k]%mod
      
print(dp[-1][5]%mod)


Fixed submission:
s=input()
n=len(s)
dp=[[0]*13 for i in range(n+1)]
dp[0][0]=1
mod=10**9+7

for i in range(n):
  if s[i]=="?":
    for j in range(10):
      for k in range(13):
        dp[i+1][(k*10+j)%13]+=dp[i][k]%mod
  else:
    for k in range(13):
      dp[i+1][(k*10+int(s[i]))%13]+=dp[i][k]%mod
      
print(dp[-1][5]%mod)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7

dp=[0]*(n+1)
dp[0]=1

if 1 not in a:
  dp[1]=1
else:
  dp[1]=0
  

for i in range(2,n+1):
  if i in a:
    continue
  dp[i]=dp[i-1]+dp[i-2]
  dp[i]%=mod
  
print(dp[n])



Fixed submission:
N,M = map(int,input().split())
a = set(int(input()) for x in range(M))
A = [0]*(N+1)
mod = 1000000007
A[0] = 1
if not(1 in a):
  A[1] = 1
for i in range(2,N+1):
    if i in a:
      A[i] = 0
    else:
      A[i] = (A[i-2] + A[i-1]) % mod
print(A[N])

Buggy python submission (verdict: Runtime Error):
n,m=mp(int,input().split())
a=[int(input()) for i in range(m)]
mod=10**9+7

dp=[0]*(n+1)
dp[0]=1

if 1 not in a:
  dp[1]=1
else:
  dp[1]=0
  

for i in range(2,n+1):
  if i in a:
    continue
  dp[i]=dp[i-1]+dp[i-2]
  dp[i]%=mod
  
print(dp[n])


Fixed submission:
N,M = map(int,input().split())
a = set(int(input()) for x in range(M))
A = [0]*(N+1)
mod = 1000000007
A[0] = 1
if not(1 in a):
  A[1] = 1
for i in range(2,N+1):
    if i in a:
      A[i] = 0
    else:
      A[i] = (A[i-2] + A[i-1]) % mod
print(A[N])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[0]*(n+1)
dp[0]=1

if 1 in a:
  dp[1]=0
else:
  dp[1]=1

for i in range(1,n):
  if i+1 not in a:
    
    dp[i+1]=(dp[i]+dp[i-1])
    dp[i+1]%=(10**9+7)
  else:
    continue
    
print(dp[n])


Fixed submission:
N,M = map(int,input().split())
a = set(int(input()) for x in range(M))
A = [0]*(N+1)
mod = 1000000007
A[0] = 1
if not(1 in a):
  A[1] = 1
for i in range(2,N+1):
    if i in a:
      A[i] = 0
    else:
      A[i] = (A[i-2] + A[i-1]) % mod
print(A[N])

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
dp=[0]*(n+1)
dp[0]=1

if 1 in a:
  dp[1]=0
else:
  dp[1]=1

for i in range(1,n):
  if i+1 not in a:
    
    dp[i+1]=(dp[i]+dp[i-1])%(10**9+7)
  else:
    dp[i+1]=0
    
print(dp[n]%(10**9+7))


Fixed submission:
N,M = map(int,input().split())
a = set(int(input()) for x in range(M))
A = [0]*(N+1)
mod = 1000000007
A[0] = 1
if not(1 in a):
  A[1] = 1
for i in range(2,N+1):
    if i in a:
      A[i] = 0
    else:
      A[i] = (A[i-2] + A[i-1]) % mod
print(A[N])
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        exit()
        
        
if f:
  print("Yes")






Fixed submission:
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        exit()
        
        

print("Yes")

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        break
        
        
if f:
  print("Yes")





Fixed submission:
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        exit()
        
        

print("Yes")

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        
        
if f:
  print("Yes")





Fixed submission:
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        exit()
        
        

print("Yes")
Buggy python submission (verdict: Runtime Error):
s=input()
a=s[0]
b=s[1]
c=s[2]
d=s[3]

if a+b+c+d==7:
  print('a+b+c+d=7')
elif a-b+c+d==7:
  print('a-b+c+d=7')
elif a-b-c+d==7:
  print('a-b-c+d=7')
elif a-b+c-d==7:
  print('a-b+c-d=7')
elif a-b-c-d==7:
  print('a-b-c-d=7')
elif a+b-c+d==7:
  print('a+b-c+d=7')
elif a+b-c-d==7:
  print('a+b-c-d=7')
else:
  print('a+b+c-d=7')


Fixed submission:
s=str(input())
a=int(s[0])
b=int(s[1])
c=int(s[2])
d=int(s[3])

if a+b+c+d==7:
  print('{}+{}+{}+{}=7'.format(a,b,c,d))
elif a-b+c+d==7:
  print('{}-{}+{}+{}=7'.format(a,b,c,d))
elif a-b-c+d==7:
  print('{}-{}-{}+{}=7'.format(a,b,c,d))
elif a-b+c-d==7:
  print('{}-{}+{}-{}=7'.format(a,b,c,d))
elif a-b-c-d==7:
  print('{}-{}-{}-{}=7'.format(a,b,c,d))
elif a+b-c+d==7:
  print('{}+{}-{}+{}=7'.format(a,b,c,d))
elif a+b-c-d==7:
  print('{}+{}-{}-{}=7'.format(a,b,c,d))
else:
  print('{}+{}+{}-{}=7'.format(a,b,c,d))