Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s=input()
if s[0::2]=='L' or s[1::2]=='R':
  print('No')
else('Yes')

Fixed submission:
s=input()
if 'L' in s[0::2] or 'R' in s[1::2]:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
x=sum(b)
for i in range(len(a)-1):
  if a[i+1]-a[i]==1:
    d=a[i-1]
    x+=c[d]
print(x)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
x=sum(b)
for i in range(len(a)-1):
  if a[i+1]-a[i]==1:
    d=a[i]
    x+=c[d-1]
print(x)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
x=sum(b)
for i in range(len(a)-1):
  if a[i+1]-a[i]==1:
    x+=c[a[i]]
print(x)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
x=sum(b)
for i in range(len(a)-1):
  if a[i+1]-a[i]==1:
    d=a[i]
    x+=c[d-1]
print(x)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
x=sum(b)
for i in range(len(a)-1):
  if a[i+1]-a[i]==1:
    d=a[i]
    x+=c[d-1]
print(x)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
total=a[0]+a[-1]
for i in range(n-2):
  total+=min(a[i],a[i+1])
print(total)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
x=[]
for i in range(b-a+1,b+a):
  x.append(i)
print(''.join(x),sep=' ')

Fixed submission:
a,b=map(int,input().split())
x=[]
for i in range(b-a+1,b+a):
  x.append(str(i))
print(' '.join(x))

Buggy python submission (verdict: Runtime Error):
k,x=map(int,input().split())
sum=''
for i in range(x-k+1,k+x):
  sum+=i
print(sum)

Fixed submission:
a,b=map(int,input().split())
x=[]
for i in range(b-a+1,b+a):
  x.append(str(i))
print(' '.join(x))
Buggy python submission (verdict: Runtime Error):
import collections

n=int(input())
lst=[]
ans=0

for i in range(n):
  s=input()
  s.sort()
  lst+=[s]
  
  c=collections.Counter(s)
  
for i in c.values():
  ans+=i*(i-1)//2
  
print(ans)

Fixed submission:
import collections

n=int(input())
lst=[]
ans=0

for i in range(n):
    s=input()
    lst.append(''.join(sorted(s)))

c=collections.Counter(lst)

for i in set(lst):
    x=c[i]

    ans+=x*(x-1)//2


print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
cnt=0
for i in range(n):
  s=input()
  s=sorted(s)
  a.append(s)
b=set(a)
for i in b:
  x=a.count(i)
  if x>0:
    cnt+=x*(x-1)//2
print(cnt)


Fixed submission:
import collections

n=int(input())
lst=[]
ans=0

for i in range(n):
    s=input()
    lst.append(''.join(sorted(s)))

c=collections.Counter(lst)

for i in set(lst):
    x=c[i]

    ans+=x*(x-1)//2


print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[]
b=[]
cnt=0
for i in range(n):
  s=input()
  s=sorted(s)
  a.append(s)
  if s not in b:
    b.append(s)
for i in b:
  x=a.count(i)
  if x>0:
    cnt+=x*(x-1)//2
print(cnt)

Fixed submission:
import collections

n=int(input())
lst=[]
ans=0

for i in range(n):
    s=input()
    lst.append(''.join(sorted(s)))

c=collections.Counter(lst)

for i in set(lst):
    x=c[i]

    ans+=x*(x-1)//2


print(ans)

Buggy python submission (verdict: Runtime Error):
def kaijyou(x):
  a=1
  for i in range(x):
    a*=i
    return a

cnt=0
n=int(input())
x=[input() for i in range(n)]
y=set(x)
for i in y:
  cnt+=kaijyou(x.count(i)-1)
print(cnt)


Fixed submission:
import collections

n=int(input())
lst=[]
ans=0

for i in range(n):
    s=input()
    lst.append(''.join(sorted(s)))

c=collections.Counter(lst)

for i in set(lst):
    x=c[i]

    ans+=x*(x-1)//2


print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n<=9:
  print(n)
elif n<=99:
  print(9)
elif n<=999:
  print(n-90)
elif n<=9999:
  print(909)
elif n==100000:
  print(90909)
else:
  print(n-9090)


Fixed submission:
a,b,c=map(int,input().split())
if (c+b-a)>0:
  print(c+b-a)
else:
  print('0')
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n<=9:
  print(n)
elif n<=99:
  print(9)
elif n<=999:
  print(n-90):
elif n<=9999:
  print(909)
elif n==100000:
  print(90909)
else:
  print(n-9090)

Fixed submission:
n=int(input())
if n<=9:
  print(n)
elif n<=99:
  print(9)
elif n<=999:
  print(n-90)
elif n<=9999:
  print(909)
elif n==100000:
  print(90909)
else:
  print(n-9090)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
ans=[0]*len(s)

for i in range(len(s)):
  while True:
    if s[i]=='L':
      if s[i]!=s[i-1]:
        ans[i]+=1
        
      else:
        i-=2
        
    if s[i]=='R':
      if s[i]!=s[i+1]:
        ans[i]+=1
        
      else:
        i+=2
        
ans=list(map(str,ans))

print(' '.join(ans))
        
    
      
        

Fixed submission:
s=input()
ans=[1]*len(s)

for i in range(len(s)):
    if s[i]=='L':
      if s[i]==s[i-1]:
        ans[i-2]+=ans[i]
        ans[i]=0
        
    elif s[i]=='R':
      if s[i]==s[i+1]:
        ans[i+2]+=ans[i]
        ans[i]=0

for i in range(len(s)-1,-1,-1):
    if s[i]=='L':
      if s[i]==s[i-1]:
        ans[i-2]+=ans[i]
        ans[i]=0
        
    elif s[i]=='R':
      if s[i]==s[i+1]:
        ans[i+2]+=ans[i]
        ans[i]=0
        
        
ans=list(map(str,ans))

print(' '.join(ans))

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
ans=[0]*len(s)

for i in range(len(s)):
  cnt=0
  pin=s[i]
  pin2=s[i]
  j=i
  while True:
    if pin2=='L':
      j-=1
      pin2=s[j]
      pin3=j
    else:
      j+=1
      pin2=s[j]
      pin3=j
      
    if pin!=pin2:
      if cnt%2==0:
        if pin2=='L':
          ans[j-1]+=1
          break
        else:
          ans[j+1]+=1
          break
      else:
        ans[pin3]+=1
        break
    
    cnt+=1
    
ans=list(map(str,ans))

print(' '.join(ans))

Fixed submission:
s=input()
ans=[1]*len(s)

for i in range(len(s)):
    if s[i]=='L':
      if s[i]==s[i-1]:
        ans[i-2]+=ans[i]
        ans[i]=0
        
    elif s[i]=='R':
      if s[i]==s[i+1]:
        ans[i+2]+=ans[i]
        ans[i]=0

for i in range(len(s)-1,-1,-1):
    if s[i]=='L':
      if s[i]==s[i-1]:
        ans[i-2]+=ans[i]
        ans[i]=0
        
    elif s[i]=='R':
      if s[i]==s[i+1]:
        ans[i+2]+=ans[i]
        ans[i]=0
        
        
ans=list(map(str,ans))

print(' '.join(ans))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a+b)%2==0:
  print(ave(a+b))
  
else:
  print('IMPOSSIBLE')


Fixed submission:
a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
  
else:
  print('IMPOSSIBLE')

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a+b)%2==0:
  print(ave(a+b))
  
else:
  print('impossible')

Fixed submission:
a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
  
else:
  print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input()split()))
b=list(map(int,input()split()))
x=sum(a)
for i in range(n):
  if a[i]>=b[i]:
    a[i]-=b[i]
  else:
    a[i]=0
    a[i+1]-=b[i]-a[i]
print(x-sum(a))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=sum(b)
for i in range(n):
  s=a[i]+a[i+1]
  t=b[i]
  x-=max(0,t-s)
  a[i+1]-=max(0,b[i]-a[i])
  a[i+1]=max(a[i+1],0)
print(x)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]
b=list(set(a))
for i in a:
  if i==b[-1]:
    print(b[-2])
  else:
    print(b[-1])

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
b=list(set(a))
if len(b)==1:
  for i in range(n):
    print(b[0])
elif a.count(b[-1])>=2:
  for i in a:
    print(b[-1])
else:
  for i in a:
    if i==b[-1]:
      print(b[-2])
    else:
      print(b[-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]
b=set(a)
for i in a:
  if i==b[-1]:
    print(b[-2])
  else:
    print(b[-1])

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]
b=list(set(a))
if len(b)==1:
  for i in range(n):
    print(b[0])
elif a.count(b[-1])>=2:
  for i in a:
    print(b[-1])
else:
  for i in a:
    if i==b[-1]:
      print(b[-2])
    else:
      print(b[-1])
Buggy python submission (verdict: Runtime Error):
import math
n,d=map(int,input().split())
x=[list(map(int,input().split())) for _ in range(n)]
cnt=0
for i in range(n):
  for j in range(i+1,n):
    sum=0
    for k in range(n):
      sum+=(x[i][k]-x[j][k])**2
    z=pow(sum,0.5)
    if math.ceil(z)==math.floor(z):
      cnt+=1
print(cnt)

Fixed submission:
import math
n,d=map(int,input().split())
x=[list(map(int,input().split())) for _ in range(n)]
cnt=0
for i in range(n):
  for j in range(i+1,n):
    sum=0
    for k in range(d):
      sum+=(x[i][k]-x[j][k])**2
    z=pow(sum,0.5)
    if math.ceil(z)==math.floor(z):
      cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

n,k=map(int,input().split())
visited=[False]*n
color=[0]*n
visited[0]=True
color[0]=k
mod=10**9+7

graph=[[] for i in range(n)]

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


Q=deque()
Q.append((0))

while Q:
  p=Q.pop()
  visited[p]=True
  ans=k
  for i in graph[p]:
      if visited[i]==False:
          Q.append((i))
      
      else:
          ans-=1

          for j in graph[i]:
            if j==p:
              continue
            if visited[j]:
              ans-=1
    
  color[p]=ans


ans=1

for i in color:
    ans*=i
    ans%=mod


print(ans)

Fixed submission:
from collections import deque

n,k=map(int,input().split())
visited=[False]*n
visited[0]=True
color=[0]*n
color[0]=k
mod=10**9+7

graph=[[] for i in range(n)]

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


Q=deque()
Q.append((0))
ans=k

while Q:
  p=Q.pop()
  cnt=0
  for i in graph[p]:
    if visited[i]==False:
        cnt+=1
        Q.append((i))
        visited[i]=True

  if p==0:
      for i in range(cnt):
          ans*=k-i-1
          ans%=mod

  else:
      for i in range(cnt):
          ans*=k-i-2
          ans%=mod


print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

n,k=map(int,input().split())
visited=[False]*n
color=[0]*n
visited[0]=True
color[0]=k
mod=10**9+7

graph=[[] for i in range(n)]

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


Q=deque()
Q.append((0))

while Q:
  p=Q.pop()
  visited[p]=True
  ans=k
  for i in graph[p]:
      if visited[i]==False:
          Q.append((i))
      
      else:
          ans-=1

      for j in graph[i]:
          if j==p:
              continue
          if visited[j]:
              ans-=1
    
  color[p]=ans


ans=1

for i in color:
    ans*=i
    ans%=mod


print(ans)

Fixed submission:
from collections import deque

n,k=map(int,input().split())
visited=[False]*n
visited[0]=True
color=[0]*n
color[0]=k
mod=10**9+7

graph=[[] for i in range(n)]

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


Q=deque()
Q.append((0))
ans=k

while Q:
  p=Q.pop()
  cnt=0
  for i in graph[p]:
    if visited[i]==False:
        cnt+=1
        Q.append((i))
        visited[i]=True

  if p==0:
      for i in range(cnt):
          ans*=k-i-1
          ans%=mod

  else:
      for i in range(cnt):
          ans*=k-i-2
          ans%=mod


print(ans%mod)
Buggy python submission (verdict: Runtime Error):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


n,k=map(int,input().split())
mod=10**9+7

red=n-k
sep=red+1


for i in range(1,k+1):
    blue=k-i
    ans=cmb(i+blue-1,blue)*cmb(sep,i)%mod
    print(ans)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


n,k=map(int,input().split())
mod=10**9+7

red=n-k
sep=red+1


for i in range(1,1+k):
    if i>sep:
        print(0)
        continue
    blue=k-i
    ans=cmb(i+blue-1,blue)*cmb(sep,i)%mod
    print(ans)
Buggy python submission (verdict: Runtime Error):
s=int(input())
if s[0]!=s[1] and s[1]!=s[2] and s[2]!=s[3]:
  print('Good')
  
else:
  print('Bad')
  

Fixed submission:
s=input()
if s[0]!=s[1] and s[1]!=s[2] and s[2]!=s[3]:
  print('Good')
  
else:
  print('Bad')
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
total=a*(a+2*b-1)//2
x=b
y=a+b-1
if (abs(x)<abs(y):
  z=x
else:
  z=y
if x<=0 and y>=0:
  print(total)
else:
  print(total-z)


Fixed submission:
a,b=map(int,input().split())
total=a*(a+2*b-1)//2
x=b
y=a+b-1
if abs(x)<abs(y):
  z=x
else:
  z=y
if x<=0 and y>=0:
  print(total)
else:
  print(total-z)

Buggy python submission (verdict: Runtime Error):
n,l=map(int,input.split())
x=(n+(2*l)-1)*n
if l<0:
  print(x//2)
else:
  print((x//2)-l)


Fixed submission:
a,b=map(int,input().split())
total=a*(a+2*b-1)//2
x=b
y=a+b-1
if abs(x)<abs(y):
  z=x
else:
  z=y
if x<=0 and y>=0:
  print(total)
else:
  print(total-z)

Buggy python submission (verdict: Runtime Error):
n,l=map(int,input.split())
x=(n+2*l-1)*n
if l<0:
  print(x//2)
else:
  print((x//2)-l)


Fixed submission:
a,b=map(int,input().split())
total=a*(a+2*b-1)//2
x=b
y=a+b-1
if abs(x)<abs(y):
  z=x
else:
  z=y
if x<=0 and y>=0:
  print(total)
else:
  print(total-z)

Buggy python submission (verdict: Runtime Error):
n,l=map(int,input.split())
if l<0:
  print(((n+(2*l)-1)*n)//2)
else:
  print((((n+(2*l)-1)*n)//2)-l)


Fixed submission:
a,b=map(int,input().split())
total=a*(a+2*b-1)//2
x=b
y=a+b-1
if abs(x)<abs(y):
  z=x
else:
  z=y
if x<=0 and y>=0:
  print(total)
else:
  print(total-z)

Buggy python submission (verdict: Runtime Error):
n,l=map(int,input.split())
if l<0:
  print(((n+2*l-1)*n)//2)
else:
  print((((n+2*l-1)*n)//2)-l)

Fixed submission:
a,b=map(int,input().split())
total=a*(a+2*b-1)//2
x=b
y=a+b-1
if abs(x)<abs(y):
  z=x
else:
  z=y
if x<=0 and y>=0:
  print(total)
else:
  print(total-z)
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
x=b-b//c-b//d+b//(c*d//math.gcd(c*d))
y=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c*d))
print(x-y)


Fixed submission:
import math
a,b,c,d=map(int,input().split())
x=b-b//c-b//d+b//(c*d//math.gcd(c,d))
y=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c,d))
print(x-y)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
x=b-b//c-b//d+b//(c*d//math.gcd(c*d))
y=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c*d))
print(x-y)

Fixed submission:
import math
a,b,c,d=map(int,input().split())
x=b-b//c-b//d+b//(c*d//math.gcd(c,d))
y=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c,d))
print(x-y)

Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
a=l
b=n+l-1
x=((a+b)*n)//2
if a<=0 and b<=0:
  print(x-b)
elif a<=0:
  print(x)
else:
  print(x-a)


Fixed submission:
import math
a,b,c,d=map(int,input().split())
x=b-b//c-b//d+b//(c*d//math.gcd(c,d))
y=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c,d))
print(x-y)

Buggy python submission (verdict: Runtime Error):
from math import gcd
a,b,c,d=map(int,input().split())
e=c*d//gcd(c,d)
print(b-(a-1)+(a-1)//c-b//c+(a-1)//d-b//d+b//e-(a-1)//e)


Fixed submission:
import math
a,b,c,d=map(int,input().split())
x=b-b//c-b//d+b//(c*d//math.gcd(c,d))
y=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c,d))
print(x-y)

Buggy python submission (verdict: Runtime Error):
from math import gcd
a,b,c,d=map(int,input().split())
e=c*d//gcd(c,d)
print((a-1)//c-b//c+(a-1)//d-b//d+b//e-(a-1)//e)

Fixed submission:
import math
a,b,c,d=map(int,input().split())
x=b-b//c-b//d+b//(c*d//math.gcd(c,d))
y=(a-1)-(a-1)//c-(a-1)//d+(a-1)//(c*d//math.gcd(c,d))
print(x-y)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=list(map(int,input().split()))
sum=0
count=1
for i in range(x):
  sum+=a[i]
  if sum<=x:
    count+=1
print(count)


Fixed submission:
n,x=map(int,input().split())
a=list(map(int,input().split()))
sum=0
count=1
for i in range(n):
  sum+=a[i]
  if sum<=x:
    count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=list(map(int,input()split()))
sum=0
count=1
for i in range(x):
  sum+=a[i]
  if sum<=x:
    count+=1
print(count)

Fixed submission:
n,x=map(int,input().split())
a=list(map(int,input().split()))
sum=0
count=1
for i in range(n):
  sum+=a[i]
  if sum<=x:
    count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=list(map(int,input()split()))
count=1
for i in range(n):
  if sum(a[:i+1])<=x:
    count+=1
print(count)


Fixed submission:
n,x=map(int,input().split())
a=list(map(int,input().split()))
sum=0
count=1
for i in range(n):
  sum+=a[i]
  if sum<=x:
    count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
a=list(map(int,input()split()))
count=0
for i in range(n):
  if sum(a[:i+1])<=x:
    count+=1
print(count)

Fixed submission:
n,x=map(int,input().split())
a=list(map(int,input().split()))
sum=0
count=1
for i in range(n):
  sum+=a[i]
  if sum<=x:
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
w=list(map(int,input().split()))
x=0
for i in range(n):
  s=abs(sum(w(0,i+1))-sum(w(i+1,n+1)))
  if x==0 or x<s:
    x=s
print(x)


Fixed submission:
from itertools import accumulate
n=int(input())
w=list(map(int,input().split()))
w=list(accumulate(w))
for i in range(n):
  if w[i]*2==w[-1]:
    print(0)
    break
  elif w[i]*2>w[-1]:
    print(min((w[i]*2-w[-1]),(w[-1]-w[i-1]*2)))
    break

Buggy python submission (verdict: Runtime Error):
n=int(input())
w=list(map(int,input().split()))
x=0
for i in range(n):
  s=abs(w[:i+1]-w[i+1:])
  if x==0 or x<s:
    x=s
print(x)


Fixed submission:
from itertools import accumulate
n=int(input())
w=list(map(int,input().split()))
w=list(accumulate(w))
for i in range(n):
  if w[i]*2==w[-1]:
    print(0)
    break
  elif w[i]*2>w[-1]:
    print(min((w[i]*2-w[-1]),(w[-1]-w[i-1]*2)))
    break

Buggy python submission (verdict: Runtime Error):
n=int(input())
w=list(map(int,input().split()))
x=0
for i in range(n):
  s=abs(w[:i+1]-w[i+1:])
  if s.count()==0 or x<s:
    x=s
print(x)

Fixed submission:
from itertools import accumulate
n=int(input())
w=list(map(int,input().split()))
w=list(accumulate(w))
for i in range(n):
  if w[i]*2==w[-1]:
    print(0)
    break
  elif w[i]*2>w[-1]:
    print(min((w[i]*2-w[-1]),(w[-1]-w[i-1]*2)))
    break
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(2,n+1):
  if i in a:
    dp[i]=0
  else:
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    
print(dp[n])

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

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

dp[0]=1

dp[1]=1

for i in a:
  dp[i]=0
  

for i in range(2,n+1):
  if dp[i]!=0:
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    
print(dp[n])
Buggy python submission (verdict: Runtime Error):
r,d,x=map(int,input().split())
for i in range(10)
  x=r*x-d
  print(x)


Fixed submission:
r,d,x=map(int,input().split())
for i in range(10):
  x=r*x-d
  print(x)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=input()
s[b-1]=s[b-1].lower()
print(s)


Fixed submission:
n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=input()
s[k-1]=s[k-1].lower()
print(s)

Fixed submission:
n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])
Buggy python submission (verdict: Runtime Error):
s=input()
if int(s[2:])!=0 and int(s[2:])<=12:
  if int(s[:2])!=0 int(s[:2])<=12:
    print('AMBIGUOUS')
  else:
    print('YYMM')
else:
  if int(s[:2])!=0 int(s[:2])<=12:
    print('MMYY')
  else:
    print('NA')


Fixed submission:
s=input()
if int(s[2:])!=0 and int(s[2:])<=12:
  if int(s[:2])!=0 and int(s[:2])<=12:
    print('AMBIGUOUS')
  else:
    print('YYMM')
else:
  if int(s[:2])!=0 and int(s[:2])<=12:
    print('MMYY')
  else:
    print('NA')

Buggy python submission (verdict: Runtime Error):
s=input()
if str(s[2:])!=0 and str(s[2:])<=12:
  if str(s[:2])!=0 str(s[:2])<=12:
    print('AMBIGUOUS')
  else:
    print('YYMM')
else:
  if str(s[:2])!=0 str(s[:2])<=12:
    print('MMYY')
  else:
    print('NA')

Fixed submission:
s=input()
if int(s[2:])!=0 and int(s[2:])<=12:
  if int(s[:2])!=0 and int(s[:2])<=12:
    print('AMBIGUOUS')
  else:
    print('YYMM')
else:
  if int(s[:2])!=0 and int(s[:2])<=12:
    print('MMYY')
  else:
    print('NA')
Buggy python submission (verdict: Runtime Error):
r,g,b,n=map(int,input().split()):
ans=0
for i in range(0,3001):
  for j in range(0,3001):
    if (n-i*r-j*g)%b==0:
      ans+=1
print(ans)

Fixed submission:
r,g,b,n=map(int,input().split())
ans=0
for i in range(0,3001):
  for j in range(0,3001):
    if (n-i*r-j*g)%b==0 and (n-i*r-j*g)>=0:
      ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,t=map(int,input().split())
print(((2t+1)//(2*a))*b)


Fixed submission:
a,b,t=map(int,input().split())
print(t//a*b)

Buggy python submission (verdict: Runtime Error):
a,b,t=map(int,input().split())
print(((2t+1)//2*a)*b)


Fixed submission:
a,b,t=map(int,input().split())
print(t//a*b)

Buggy python submission (verdict: Runtime Error):
a,b,t=map(int,input().split())
print(((2t+1)//2a)*b)


Fixed submission:
a,b,t=map(int,input().split())
print(t//a*b)
Buggy python submission (verdict: Runtime Error):
a=int(print())
b=int(print())
c=int(print())
d=int(print())
e=int(print())
k=int(print())

if (e-a)<=k:
  print('Yay!')

else:
  print(':(')

Fixed submission:
a=[int(input()) for i in range(5)]
k=int(input())
x=max(a)-min(a)
if x<=k:
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a=int(print())
b=int(print())
c=int(print())
d=int(print())
e=int(print())
k=int(print())

x=[a,b,c,d,e]
y=max(x)-min(x)

if y>k:
  print(':(')
if y<=k:
  print('Yay!')


Fixed submission:
a=[int(input()) for i in range(5)]
k=int(input())
x=max(a)-min(a)
if x<=k:
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a=int(print())
b=int(print())
c=int(print())
d=int(print())
e=int(print())
k=int(print())

x=[a,b,c,d,e]
y=max(x)-min(x)

if y>k:
  print(':(')
else:
  print('Yay!')


Fixed submission:
a=[int(input()) for i in range(5)]
k=int(input())
x=max(a)-min(a)
if x<=k:
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a=int(print())
b=int(print())
c=int(print())
d=int(print())
e=int(print())
k=int(print())

x=[a,b,c,d,e]
y=max(x)-min(x)

if y>=k:
  print('Yay!')
else:
  print(':(')


Fixed submission:
a=[int(input()) for i in range(5)]
k=int(input())
x=max(a)-min(a)
if x<=k:
  print('Yay!')
else:
  print(':(')

Buggy python submission (verdict: Runtime Error):
a=print()
b=print()
c=print()
d=print()
e=print()
k=print()

x=[a,b,c,d,e]
y=max(x)-min(x)

if y>=k:
  print('Yay!')
else:
  print(':(')

Fixed submission:
a=[int(input()) for i in range(5)]
k=int(input())
x=max(a)-min(a)
if x<=k:
  print('Yay!')
else:
  print(':(')
Buggy python submission (verdict: Runtime Error):
import math
a=list[int(input()) for _ in range(5)]
x=0
y=0
for i in a:
  x+=math.ceil(i)
  if i%10>y:
    y=i%10
print(x+y-10)

Fixed submission:
from math import ceil
a=[int(input()) for i in range(5)]
ans=10
sum=0
for i in a:
  x=(i-1)%10+1
  ans=min(ans,x)
  sum+=ceil(i/10)*10
if ans==10:
  print(sum)
else:
  print(sum+ans-10)