Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
CHECK=[0 for i in range(2021)]
ans=0
S=int(s)
for i in range(len(s)):
    temp=(S%pow(10,i+1))%2019
    if temp==0:
        ans+=1
    elif CHECK[temp]==0:
        CHECK[temp]=1
    else:
        ans+=1
 
print(ans)

Fixed submission:

S=input()
s=[0 for i in range(len(S))]

for i in range(len(S)):
    s[i]=int(S[i])
CHECK=[0 for i in range(2021)]
ans=0
temp=0
for i in range(1,len(s)+1):
    #print(s[-i])
    temp=(temp+s[-i]*pow(10,i-1,2019)+2019*2)%2019
    #print(i,temp)
    #print(temp)
    CHECK[temp]+=1
for i in CHECK:
    ans+=i*(i-1)//2

ans+=CHECK[0]
 
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import decimal
input=sys.stdin.readline


s=input()
CHECK=set()
ans=0
S=int(s)
for i in range(len(s)-1):
    
    temp=(S%pow(10,i+1))%2019
    if temp==0:
        ans+=1
    elif temp not in CHECK:
        CHECK.add(temp)
    else:
        ans+=1

print(ans)

Fixed submission:

S=input()
s=[0 for i in range(len(S))]

for i in range(len(S)):
    s[i]=int(S[i])
CHECK=[0 for i in range(2021)]
ans=0
temp=0
for i in range(1,len(s)+1):
    #print(s[-i])
    temp=(temp+s[-i]*pow(10,i-1,2019)+2019*2)%2019
    #print(i,temp)
    #print(temp)
    CHECK[temp]+=1
for i in CHECK:
    ans+=i*(i-1)//2

ans+=CHECK[0]
 
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*(M))))N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*(M))))

Fixed submission:
N,M=[int(x) for x in input().split()]
print(min(abs(N-N//M*M),abs(N-(N//M+1)*M)))
Buggy python submission (verdict: Time Limit Exceeded):
A,B=[int(x) for x in str(input()).split()]

X=[]
m=len(bin(B)[2:])
for j in range(A,B+1):
  temp=bin(j)[2:]
  for i in range(m-len(temp)):
    temp="0"+temp
  X.append(temp)

diff=B-A+1
t=diff%2
ans=""
for j in range(m-1):
  if t==0:
    if A%2==0:
      ans+="0"
    else:
      if X[0][j]==X[-1][j]:
        ans+="0"
      else:
        ans+="1"
  if t==1:
    if A%2==0:
      ans+=X[-1][j]
    else:
      ans+=X[0][j]

if diff%4==0:
  ans+="0"
elif diff%4==1:
  if A%2==0:
    ans+="0"
  else:
    ans+="1"
elif diff%4==2:
  ans+="1"
elif diff%4==3:
  if A%2==0:
    ans+="1"
  else:
    ans+="0"



print(int(ans,2))



Fixed submission:
A,B=[int(x) for x in str(input()).split()]

X=[]
m=len(bin(B)[2:])
temp=bin(A)[2:]
for i in range(m-len(temp)):
  temp="0"+temp
X.append(temp)
X.append(bin(B)[2:])


diff=B-A+1
t=diff%2
ans=""
for j in range(m-1):
  if t==0:
    if A%2==0:
      ans+="0"
    else:
      if X[0][j]==X[-1][j]:
        ans+="0"
      else:
        ans+="1"
  if t==1:
    if A%2==0:
      ans+=X[-1][j]
    else:
      ans+=X[0][j]

if diff%4==0:
  ans+="0"
elif diff%4==1:
  if A%2==0:
    ans+="0"
  else:
    ans+="1"
elif diff%4==2:
  ans+="1"
elif diff%4==3:
  if A%2==0:
    ans+="1"
  else:
    ans+="0"



print(int(ans,2))
Buggy python submission (verdict: Time Limit Exceeded):
N,M=[int(x) for x in input().split()]
X=[0,2,5,5,4,5,6,3,7,6]
#    1,2,3,4,5,6,7,8,9

A=[int(x) for x in input().split()]



def po(num):
	ans=1
	if num!=0:
		while (num//10>=1):
			ans+=1
			num=num//10
	return ans-1

ANS=[0]
for i in range(1,N+1):
	ans=0
	for j in A:
		if i==X[j]:
			ans=max(j,ans)
		elif i>=X[j]:
			temp=ANS[i-X[j]]
			if temp!=0:
				power=po(temp)
				ans=max(ans,10*temp+j)
		
		#print(ans)
	ANS.append(ans)
print(ANS[-1])
	


Fixed submission:
N,M=[int(x) for x in input().split()]
X=[0,2,5,5,4,5,6,3,7,6]
#    1,2,3,4,5,6,7,8,9

A=[int(x) for x in input().split()]



ANS=[0]
for i in range(1,N+1):
	ans=0
	for j in A:
		if i==X[j]:
			ans=max(j,ans)
		elif i>=X[j]:
			temp=ANS[i-X[j]]
			if temp!=0:

				ans=max(ans,10*temp+j)
		
		#print(ans)
	ANS.append(ans)
print(ANS[-1])
Buggy python submission (verdict: Time Limit Exceeded):

N,M=[int(x) for x in str(input()).split()]
lim=int(M**0.5)+10000000

prime_sieve=[1 for i in range(lim)]


prime_sieve[0]=0
prime_sieve[1]=0

prime=[]
count=[]
for i in range(2,lim):
  if prime_sieve[i]==1:
    prime.append(i)
    count.append(0)
    for j in range(2,(lim-1)//i+1):
      prime_sieve[i*j]=0

for i in range(len(prime)):
  while M%prime[i]==0:
    count[i]+=1
    M=M//prime[i]
  if M==1:
    break


num=10**9+7
x=1
factorial=[1]
for i in range(1,2*10**5+1):
  x=(i*x)%num
  factorial.append(x)
 
rfactorial=[]
for i in factorial:
  rfactorial.append(pow(i,num-2,num))
 

def c(n,k):
  return (((factorial[n]*rfactorial[k])%num)*rfactorial[n-k])%num


ans=1
for i in range(len(prime)):
  ans=(ans*c(N-1+count[i],count[i]))%num
print(ans)


Fixed submission:

N,M=[int(x) for x in str(input()).split()]
lim=int(M**0.5)+100005




num=10**9+7
x=1
factorial=[1]
for i in range(1,2*10**5+1):
  x=(i*x)%num
  factorial.append(x)
 
rfactorial=[]
for i in factorial:
  rfactorial.append(pow(i,num-2,num))
 

def c(n,k):
  return (((factorial[n]*rfactorial[k])%num)*rfactorial[n-k])%num


ans=1
for i in range(2,int(M**0.5)+2):
  count=0
  while M%i==0:
    count+=1
    M=M//i
  ans=(ans*c(N+count-1,count))%num
if M>1:
  ans=(ans*c(N,1))%num

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
H, W, D=[int(x) for x in str(input()).split()]
A=[[0 for x in range(W+1)]]
for i in range(1,H+1):
  b=[0]
  b+=[int(x) for x in str(input()).split()]
  A.append(b)
Q=int(input())
LR=[[0 for x in range(3)]]
for i in range(1,Q+1):
  b=[0]
  b+=[int(x) for x in str(input()).split()]
  LR.append(b)



B=[0 for x in range(H*W+1)]
for i in range(1,W+1):
  for j in range(1,H+1):
    B[A[j][i]]=[j,i]
ans=[]
for i in range (1,Q+1):
  s=0
  x=LR[i][1]
  while x!=LR[i][2]:
    s+=abs(B[x][0]-B[x+D][0])+abs(B[x][1]-B[x+D][1])
    x+=D
  ans.append(s)
for i in ans:
  print(i)


Fixed submission:
H, W, D=[int(x) for x in str(input()).split()]
A=[[0 for x in range(W+1)]]
for i in range(1,H+1):
  b=[0]
  b+=[int(x) for x in str(input()).split()]
  A.append(b)
Q=int(input())
LR=[[0 for x in range(3)]]
for i in range(1,Q+1):
  b=[0]
  b+=[int(x) for x in str(input()).split()]
  LR.append(b)












B=[0 for x in range(H*W+1)]
for i in range(1,W+1):
  for j in range(1,H+1):
    B[A[j][i]]=[j,i]

XY=[0]
for i in range(1,D+1):

  C=[]
  x=i
  s=0
  while x<(H*W-D+1):

    s+=abs(B[x][0]-B[x+D][0])+abs(B[x][1]-B[x+D][1])
    C.append(s)
    x+=D

  C.append(s+abs(B[i][0]-B[x][0])+abs(B[i][1]-B[x][1]))
  XY.append(C)


def mo(x,y):
  if x%y==0:
    return y
  else:
    return x%y

def br(x):
  if x<=0:
    return 0
  else:
    return int(x)

ans=[]
for i in range (1,Q+1):
  if LR[i][1]<LR[i][2] and LR[i][1]==mo(LR[i][1],D):
    g=XY[mo(LR[i][1],D)][br((LR[i][1]-0.1)//D-1)]
    h=XY[mo(LR[i][1],D)][br((LR[i][2]-0.1)//D-1)]

    ans.append(h)
  elif LR[i][1]<LR[i][2]:
    g=XY[mo(LR[i][1],D)][br((LR[i][1]-0.1)//D-1)]
    h=XY[mo(LR[i][1],D)][br((LR[i][2]-0.1)//D-1)]

    ans.append(h-g)
  elif LR[i][1]>LR[i][2]:
    g=XY[mo(LR[i][2],D)][br((LR[i][2]+0.1)//D)-2]
    h=XY[mo(LR[i][2],D)][-1]-XY[mo(LR[i][1],D)][br((LR[i][2]+0.1)//D-2)]
    ans.append(h+g)
  else:
    ans.append(0)

for i in ans:
  print(i)
Buggy python submission (verdict: Runtime Error):

M=pow(10,5)

prime_sieve=[-1 for i in range(M+1)]
prime_sieve[0]=1
prime_sieve[1]=1

primes=[]
for i in range(M+1):
  if prime_sieve[i]==-1:
    primes.append(i)
    for j in range(2,(M+1)//i+1):
      prime_sieve[i*j]=1
#print(prime_sieve)
rangesum=[0,0,0]
sum=0
for i in range(3,M+1):
  if prime_sieve[i]==-1:
    if prime_sieve[(i+1)//2]==-1:
       sum+=1
       #print(i,sum)
  rangesum.append(sum)

Q=int(input())
for i in range(Q):
  l,r=[int(x) for x in str(input()).split()]
  print(rangesum[r]-rangesum[l-1])


Fixed submission:

M=pow(10,5)

prime_sieve=[-1 for i in range(M+1)]
prime_sieve[0]=1
prime_sieve[1]=1

primes=[]
for i in range(M+1):
  if prime_sieve[i]==-1:
    primes.append(i)
    for j in range(2,(M)//i+1):
      prime_sieve[i*j]=1
#print(prime_sieve)
rangesum=[0,0,0]
sum=0
for i in range(3,M+1):
  if prime_sieve[i]==-1:
    if prime_sieve[(i+1)//2]==-1:
       sum+=1
       #print(i,sum)
  rangesum.append(sum)

Q=int(input())
for i in range(Q):
  l,r=[int(x) for x in str(input()).split()]
  print(rangesum[r]-rangesum[l-1])

Buggy python submission (verdict: Runtime Error):

M=pow(10,2)

prime_sieve=[-1 for i in range(M+1)]
prime_sieve[0]=1
prime_sieve[1]=1

primes=[]
for i in range(M+1):
  if prime_sieve[i]==-1:
    primes.append(i)
    for j in range(2,(M+1)//i+1):
      prime_sieve[i*j]=1
#print(prime_sieve)
rangesum=[0,0,0]
sum=0
for i in range(3,M+1):
  if prime_sieve[i]==-1:
    if prime_sieve[(i+1)//2]==-1:
       sum+=1
       #print(i,sum)
  rangesum.append(sum)

Q=int(input())
for i in range(Q):
  l,r=[int(x) for x in str(input()).split()]
  print(rangesum[r]-rangesum[l-1])












Fixed submission:

M=pow(10,5)

prime_sieve=[-1 for i in range(M+1)]
prime_sieve[0]=1
prime_sieve[1]=1

primes=[]
for i in range(M+1):
  if prime_sieve[i]==-1:
    primes.append(i)
    for j in range(2,(M)//i+1):
      prime_sieve[i*j]=1
#print(prime_sieve)
rangesum=[0,0,0]
sum=0
for i in range(3,M+1):
  if prime_sieve[i]==-1:
    if prime_sieve[(i+1)//2]==-1:
       sum+=1
       #print(i,sum)
  rangesum.append(sum)

Q=int(input())
for i in range(Q):
  l,r=[int(x) for x in str(input()).split()]
  print(rangesum[r]-rangesum[l-1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
T=[0]+[int(x) for x in str(input()).split()]+[0]
V=[0]+[int(x) for x in str(input()).split()]+[0]
time=0
t=[0]
for i in T:
  time+=i
  t.append(time)
ans=0

for j in range(0,2*time):
  m2=100000000
  m1=100000000
  t1=j/2
  t2=(j+1)/2
  print(t1,t2)
  for i in range(N+2):
	a=t[i]
	b=t[i+1]
	c=V[i]
    if t1<=a:
      m1=min(m1,c+(a-t1))
    elif t1<=b:
      m1=min(m1,c)
    else:
      m1=min(m1,c+t1-b)

    if t2<=a:
      m2=min(m2,c+(a-t2))
    elif t2<=b:
      m2=min(m2,c)
    else:
      m2=min(m2,c+t2-b)
    
  ans+=0.25*(m1+m2)
print(ans)





Fixed submission:
N=int(input())
T=[0]+[int(x) for x in str(input()).split()]+[0]
V=[0]+[int(x) for x in str(input()).split()]+[0]
 
time=0
t=[0]
for i in T:
  time+=i
  t.append(time)
ans=0
 
for j in range(0,2*time):
  m1=1000000000
  m2=1000000000
  t1=j/2
  t2=(j+1)/2
  for i in range(N+2):
    if t1<=t[i]:
      m1=min(m1,V[i]+(t[i]-t1))
    elif t1<=t[i+1]:
      m1=min(m1,V[i])
    else:
      m1=min(m1,V[i]+t1-t[i+1])
 
    if t2<=t[i]:
      m2=min(m2,V[i]+(t[i]-t2))
    elif t2<=t[i+1]:
      m2=min(m2,V[i])
    else:
      m2=min(m2,V[i]+t2-t[i+1])
    
  #print(1,m1,m2)
  ans+=0.25*(m1+m2)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
T=[0]+[int(x) for x in str(input()).split()]+[0]
V=[0]+[int(x) for x in str(input()).split()]+[0]

time=0
t=[0]
for i in T:
  time+=i
  t.append(time)
ans=0

for j in range(0,2*time):
  m1=1000000000
  m2=1000000000
  t1=j/2
  t2=(j+1)/2
  for i in range(N+2):
    if t1<=t[i]:
      m1=min(m1,V[i]+(t[i]-t1))
    elif t1<=t[i+1]:
      m1=min(m1,V[i])
    else:
      m1=min(m1,V[i]+t1-t[i+1])

    if t2<=t[i]:
      m2=min(m2,V[i]+(t[i]-t2))
    elif t2<=t[i+1]:
      m2=min(m2,V[i])
    else:
      m2=min(m2,V[i]+t2-t[i+1])
    
  #print(1,m1,m2)
  ans+=0.25*(m1+m2)
print(ans)





Fixed submission:
N=int(input())
T=[0]+[int(x) for x in str(input()).split()]+[0]
V=[0]+[int(x) for x in str(input()).split()]+[0]
 
time=0
t=[0]
for i in T:
  time+=i
  t.append(time)
ans=0
 
for j in range(0,2*time):
  m1=1000000000
  m2=1000000000
  t1=j/2
  t2=(j+1)/2
  for i in range(N+2):
    if t1<=t[i]:
      m1=min(m1,V[i]+(t[i]-t1))
    elif t1<=t[i+1]:
      m1=min(m1,V[i])
    else:
      m1=min(m1,V[i]+t1-t[i+1])
 
    if t2<=t[i]:
      m2=min(m2,V[i]+(t[i]-t2))
    elif t2<=t[i+1]:
      m2=min(m2,V[i])
    else:
      m2=min(m2,V[i]+t2-t[i+1])
    
  #print(1,m1,m2)
  ans+=0.25*(m1+m2)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding:utf-8 -*-

# input
N = int(input())
X = list(map(int, input().split()))

# solve
X_sorted = sorted(X)
for i in range(len(X)):
    Y = list(X_sorted)
    Y.remove(X[i])
    print(Y[int((len(Y)+1)/2-1)])


Fixed submission:
# -*- coding:utf-8 -*-

# input
N = int(input())
X = list(map(int, input().split()))

# solve
X_sorted = sorted(X)
n0 = X_sorted[int(len(X_sorted)/2-1)]
n1 = X_sorted[int(len(X_sorted)/2)]
for i in range(len(X)):
    if (n1 > X[i]):
        print(n1)
    elif (n0 <= X[i]):
        print(n0)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding:utf-8 -*-

# input
N = int(input())
X = list(map(int, input().split()))

# solve
for i in range(len(X)):
    X_ = list(X)
    X_.pop(i)
    X_ = sorted(X_)
    print(X_[int((len(X_)+1)/2-1)])


Fixed submission:
# -*- coding:utf-8 -*-

# input
N = int(input())
X = list(map(int, input().split()))

# solve
X_sorted = sorted(X)
n0 = X_sorted[int(len(X_sorted)/2-1)]
n1 = X_sorted[int(len(X_sorted)/2)]
for i in range(len(X)):
    if (n1 > X[i]):
        print(n1)
    elif (n0 <= X[i]):
        print(n0)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = np.array(map(int, input().split()))


A = np.append(np.append([0], A), [0])
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += np.abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - np.abs(A[i + 1] - A[i]) - np.abs(A[i] - A[i - 1]) + np.abs(A[i + 1] - A[i - 1])
    print(partial_sum)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = map(int, input().split())
A = list(A)

A = [0] + A + [0]
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - abs(A[i + 1] - A[i]) - abs(A[i] - A[i - 1]) + abs(A[i + 1] - A[i - 1])
    print(partial_sum)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = np.array(map(int, raw_input().split()))


A = np.append(np.append([0], A), [0])
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += np.abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - np.abs(A[i + 1] - A[i]) - np.abs(A[i] - A[i - 1]) + np.abs(A[i + 1] - A[i - 1])
    print partial_sum


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = map(int, input().split())
A = list(A)

A = [0] + A + [0]
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - abs(A[i + 1] - A[i]) - abs(A[i] - A[i - 1]) + abs(A[i + 1] - A[i - 1])
    print(partial_sum)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8


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


# solve
for i in range(N):
    t = 0
    B = list(A)
    B.pop(i)
    j = 0
    while (True):
        # 最初
        if (j == 0):
            t += abs(B[j])
            j += 1
        # 最後
        elif (j == len(B)):
            t += abs(B[j-1])
            break
        else:
            t += abs(B[j] - B[j-1])
            j += 1
    print(t)


Fixed submission:
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = map(int, input().split())
A = list(A)

A = [0] + A + [0]
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - abs(A[i + 1] - A[i]) - abs(A[i] - A[i - 1]) + abs(A[i + 1] - A[i - 1])
    print(partial_sum)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split(' '))
blue = ''
red = ''
count = int(N / (A + B))

for i in range(A):
    blue = blue + 'b'
for i in range(B):
    red = red + 'r'
one_roop = blue + red
string = ''
for i in range(count):
    string = string + one_roop

if N % (A + B) != 0:
    string = string + one_roop[0:N % (A + B)]

print(string.count('b'))

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

count = int(N / (A + B))
blue_balls = count * A

if N % (A + B) != 0:
    if N % (A + B) > A:
        blue_balls += A
    else:
        blue_balls += N % (A + B)

print(blue_balls)

Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split(' '))
blue_balls = 0
red_balls = 0
flag = 0
count = 0
while count < N:
    if flag == 0:
        if count + A > N:
            blue_balls += N - count
            count += A
            flag = 1
        else:
            blue_balls += A
            count += A
            flag = 1
    if flag == 1:
        red_balls += B
        count += B
        flag = 0

print(blue_balls)

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

count = int(N / (A + B))
blue_balls = count * A

if N % (A + B) != 0:
    if N % (A + B) > A:
        blue_balls += A
    else:
        blue_balls += N % (A + B)

print(blue_balls)
Buggy python submission (verdict: Runtime Error):
import math
 
N=int(input())

A=[]

for i in range(1,int(math.sqrt(N))):
  if N % i ==0:
    A.append(i)
    A.append(int(N/i))
    
A.sort()
base = int(len(A)/2)
print(A[base]-1 +A[base-1] -1)

Fixed submission:
import math
 
N=int(input())

A=[]

for i in range(1,int(math.sqrt(N))+1):
  if N % i ==0:
    A.append(i)
    A.append(int(N/i))
    
A.sort()
base = int(len(A)/2)

print(A[base]-1 +A[base-1] -1)

Buggy python submission (verdict: Runtime Error):
import math
 
N=int(input())



A=[]

for i in range(1,int(math.sqrt(N))):
  if N % i ==0:
    A.append(i)
    A.append(int(N/i))
    
A.sort()
base = int(len(A)/2)
print(A[base]-1 +A[base-1] -1)

Fixed submission:
import math
 
N=int(input())

A=[]

for i in range(1,int(math.sqrt(N))+1):
  if N % i ==0:
    A.append(i)
    A.append(int(N/i))
    
A.sort()
base = int(len(A)/2)

print(A[base]-1 +A[base-1] -1)

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

A=[]

for i in range(1,N+1):
  if N % i ==0:
    A.append(i)

base = int(len(A)/2)

print(A[base]-1 +A[base-1] -1)

Fixed submission:
import math
 
N=int(input())

A=[]

for i in range(1,int(math.sqrt(N))+1):
  if N % i ==0:
    A.append(i)
    A.append(int(N/i))
    
A.sort()
base = int(len(A)/2)

print(A[base]-1 +A[base-1] -1)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split(' '))

broken_list = []
if M > 0:
    for i in range(M):
        broken_list.append(int(input()))

nums = [0] * (N + 1)
nums[0] = 1

if 1 not in broken_list:
    nums[1] = 1

for i in range(2, N + 1):
    nums[i] = nums[i - 1] + nums[i - 2]
    if i in broken_list:
        nums[i] = 0

print(nums[N] % 1000000007)

Fixed submission:
N, M = map(int, input().split(' '))

broken_list = []
if M > 0:
    for i in range(M):
        broken_list.append(int(input()))
        
broken_set =set(broken_list)
nums = [0] * (N + 1)
nums[0] = 1

if 1 not in broken_set:
    nums[1] = 1

for i in range(2, N + 1):
    nums[i] = nums[i - 1] + nums[i - 2]
    if i in broken_set:
        nums[i] = 0

print(nums[N] % 1000000007)
Buggy python submission (verdict: Runtime Error):
K= int(input())
A, B = map(int, input().split())
i = 0
while A <= B:
  if A / K == A // K:
    i = i + 1
    A = A + 1
  else:
    i = i + 0
    A = A + 1
    
if i = 0:
  print("NG")
else:
  print("OK")

Fixed submission:
K= int(input())
A, B = map(int, input().split())
i = 0
while A <= B:
  if A / K == A // K:
    i = i + 1
    A = A + 1
  else:
    i = i + 0
    A = A + 1
    
if i == 0:
  print("NG")
else:
  print("OK")

Buggy python submission (verdict: Runtime Error):
K= int(input())
A, B = map(int, input().split())
i = 0
while A <= B:
  if K / 4 == K // 4:
    i = i + 1
    A = A + 1
  else:
    i = i + 0
    A = A + 1
    
if i = 0:
  print("NG")
else:
  print("OK")

Fixed submission:
K= int(input())
A, B = map(int, input().split())
i = 0
while A <= B:
  if A / K == A // K:
    i = i + 1
    A = A + 1
  else:
    i = i + 0
    A = A + 1
    
if i == 0:
  print("NG")
else:
  print("OK")
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
N = int(input())
i = 0
j = 0
k = 0

while N > 0:
  dice = int(input())
  while i < 3:
    if A[i] == int(dice):
      A[i] = "z"
      i = i + 1
  while j < 3:
    if B[j] == dice:
      B[j] = "z"
      j = j + 1
  while k < 3:
    if C[k] == dice:
      C[k] = "z"
      k = k + 1
  N = N - 1
      
if A[0] == A[1] == A[2] == "z" or B[0] == B[1] == B[2] == "z" or C[0] == C[1] == C[2] == "z" or A[0] == B[0] == C[0] == "z" or A[1] == B[1] == C[1] == "z" or A[2] == B[2] == C[2] == "z" or A[0] == B[1] == C[2] == "z" or A[2] == B[1] == C[0] == "z":
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
if N / 2 == N // 2:
  print(int(N / 2))
else:
  print(int(N // 2 + 1))
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
while K > 0:
  if A > 0:
    A = A - 1
    K = K - 1
  elif A == 0 and B > 0:
    B = B - 1
    K = K - 1

print(str(A) + " " + str(B))

Fixed submission:
S, T = map(str, input().split())
print(T+S)
Buggy python submission (verdict: Runtime Error):
S = input()
if S = 'SUN':
  print(7)
elif S = 'MON':
  print(6)
elif S = 'TUE':
  print(5)
elif S = 'WED':
  print(4)
elif S = 'THU':
  print(3)
elif S = 'FRI':
  print(2)
elif S = 'SAT':
  print(1)

Fixed submission:
S = input()
if S == 'SUN':
  print(7)
elif S == 'MON':
  print(6)
elif S == 'TUE':
  print(5)
elif S == 'WED':
  print(4)
elif S == 'THU':
  print(3)
elif S == 'FRI':
  print(2)
elif S == 'SAT':
  print(1)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()
if a < 3200, a >=2800:
  print(s)
else:
  print('red')

Fixed submission:
a = int(input())
s = input()
if a >= 3200 and a < 5000:
  print(s)
elif a >= 2800 and a < 3200:
  print('red')
Buggy python submission (verdict: Runtime Error):
b = input()
if b = 'A':
  print('T')
elif b = 'T':
  print('A')
elif b = 'C':
  print('G')
elif b = 'G':
  print('C')

Fixed submission:
b = input()
if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
elif b == 'G':
  print('C')
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
B // A = D
if D >=C:
  print(C)
else:
  print(D)

Fixed submission:
A, B, C = map(int, input().split())
D = B // A 
if D >=C:
  print(C)
else:
  print(D)
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
S = A * B // 2
print(S)

Fixed submission:
T, X = map(int, input().split())
t = T / X
print(t)
Buggy python submission (verdict: Runtime Error):
D = int(input())
if D = 25:
  print('Christmas')
elif D = 24:
  print('Christmas Eve')
elif D = 23:
  print('Christmas Eve Eve')
elif D = 22:
  print('Christmas Eve Eve Eve')

Fixed submission:
D = int(input())
if D == 25:
  print('Christmas')
elif D == 24:
  print('Christmas Eve')
elif D == 23:
  print('Christmas Eve Eve')
elif D == 22:
  print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Runtime Error):
X = int(input())
if X = 3 or 5 or 7:
  print('Yes')
else:
  print('No')

Fixed submission:
X = int(input())
if X == 3 or X == 5 or X == 7:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
if N == 1:
  print('Hello World')
elif N == 2:
  S = A + B
  print(S)

Fixed submission:
N = int(input())
if N == 1:
  print('Hello World')
elif N == 2:
  A = int(input())
  B = int(input())
  S = A + B
  print(S)
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
if a // 2 == a / 2 or b // 2 == b / 2:
  print('Even')
else:
  print('Odd')

Fixed submission:
a, b = map(int, input().split())
if a // 2 == a / 2 or b // 2 == b / 2:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
a=[int(input())]
if a==("ABC"):
	print("ARC")
else:
  	print("ABC")
 

Fixed submission:
a=input()

if a =="ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
a = int(a)
b = int(b)

if a * b % 2 == 0:
   print('Even')
else:
   print('Odd')


Fixed submission:
a, b = map(int, input().split())
if (a*b)%2:
   print('Odd')
else:
   print('Even')