Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
fastinput=sys.stdin.readline
N=int(input())
a=[int(i) for i in fastinput().split()]
result=[None]*N
if N%2:#odd
    c=(N-1)//2
    for num,i in enumerate(a):
        r=(num+1)//2
        if num==0:
            result[c]=i
        else:
            if num%2:#右半分
                result[c+r]=i
            else:
                result[c-r]=i
else:#even
    for num,i in enumerate(a):
        d=(N-i)//2
        if num%2:#左半分
            result[d]=i
        else:
            result[N-1-d]=i
print(" ".join([str(j) for j in result]))
            

Fixed submission:
import sys
fastinput=sys.stdin.readline
N=int(input())
a=[int(i) for i in fastinput().split()]
result=[None]*N
if N%2:#odd
    c=(N-1)//2
    for num,i in enumerate(a):
        r=(num+1)//2
        if num==0:
            result[c]=i
        else:
            if num%2:#右半分
                result[c+r]=i
            else:
                result[c-r]=i
else:#even
    for num,i in enumerate(a):
        d=(N-num-1)//2
        if num%2:#左半分
            result[d]=i
        else:
            result[N-1-d]=i
print(" ".join([str(j) for j in result]))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(500000)
N=int(input())
A=[int(input())-1 for _ in range(N)]
result=[]
app=result.append
def next(k):
	newlight=A[k]
	if k==1:
		return(1)
	elif k in result:
		return(0)
	else:
		app(k)
		return(next(newlight))
if not next(0):
	print(-1)
else:print(len(result))

Fixed submission:
import sys
sys.setrecursionlimit(500000)
N=int(input())
A=[int(input())-1 for _ in range(N)]
result=[False]*N
def next(k):
	newlight=A[k]
	if k==1:
		return(1)
	elif result[k]:
		return(0)
	else:
		result[k]=True
		return(next(newlight))
if not next(0):
	print(-1)
else:print(sum(result))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(500000)
N=int(input())
A=[int(input())-1 for _ in range(N)]
result=[]
app=result.append
def next(k):
	newlight=A[k]
	if k==1:
		return(1)
	elif k in result:
		return(0)
	else:
		app(k)
		return(next(newlight))
if not next(0):
	print(-1)
else:print(len(result))

Fixed submission:
import sys
sys.setrecursionlimit(500000)
N=int(input())
A=[int(input())-1 for _ in range(N)]
result=[False]*N
def next(k):
	newlight=A[k]
	if k==1:
		return(1)
	elif result[k]:
		return(0)
	else:
		result[k]=True
		return(next(newlight))
if not next(0):
	print(-1)
else:print(sum(result))

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(5000)
N=int(input())
A=[int(input())-1 for _ in range(N)]
result=[]
app=result.append
def next(k):
	newlight=A[k]
	if k==1:
		return(1)
	elif k in result:
		return(0)
	else:
		app(k)
		return(next(newlight))
if not next(0):
	print(-1)
else:print(len(result))

Fixed submission:
import sys
sys.setrecursionlimit(500000)
N=int(input())
A=[int(input())-1 for _ in range(N)]
result=[False]*N
def next(k):
	newlight=A[k]
	if k==1:
		return(1)
	elif result[k]:
		return(0)
	else:
		result[k]=True
		return(next(newlight))
if not next(0):
	print(-1)
else:print(sum(result))

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[int(input())-1 for _ in range(N)]
result=[]
app=result.append
def next(k):
	print(result,k)
	newlight=A[k]
	if k==1:
		return(1)
	elif k in result:
		return(0)
	else:
		app(k)
		return(next(newlight))
if not next(0):
	print(-1)
else:print(len(result))

Fixed submission:
import sys
sys.setrecursionlimit(500000)
N=int(input())
A=[int(input())-1 for _ in range(N)]
result=[False]*N
def next(k):
	newlight=A[k]
	if k==1:
		return(1)
	elif result[k]:
		return(0)
	else:
		result[k]=True
		return(next(newlight))
if not next(0):
	print(-1)
else:print(sum(result))
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=[int(i) for i in input().split()]
rates=[0]*9
for rate in a:
    rates[rate//400]+=1
ans=0
for color in rates[:8]:
    ans+=(color!=0)
ansmax=ans+rates[8]
print(ans,ansmax)

Fixed submission:
N=int(input())
a=[int(i) for i in input().split()]
rates=[0]*9
for rate in a:
    rates[min(rate//400,8)]+=1
ans=0
for color in rates[:8]:
    ans+=(color!=0)
ansmax=ans+rates[8]
print(max(ans,1),ansmax)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=[int(i) for i in input().split()]
rates=[0]*9
for rate in a:
    rates[rate//400]+=1
ans=0
for color in rates[:8]:
    ans+=bool(color)
ansmax=ans+rates[8]
print(ans,ansmax)

Fixed submission:
N=int(input())
a=[int(i) for i in input().split()]
rates=[0]*9
for rate in a:
    rates[min(rate//400,8)]+=1
ans=0
for color in rates[:8]:
    ans+=(color!=0)
ansmax=ans+rates[8]
print(max(ans,1),ansmax)
Buggy python submission (verdict: Runtime Error):
N=int(input())
Q=sorted([int(input()) for i in range(N)])
S=sum(Q)
mods=S%10
if mods!=0:
    ans=S
else:
    for i in Q:
        if i%10!=0:
            ans=S-i
            break
print(ans)

Fixed submission:
N=int(input())
Q=sorted([int(input()) for i in range(N)])
S=sum(Q)
mods=S%10
if mods!=0:
    ans=S
else:
    for n,i in enumerate(Q):
        if i%10!=0:
            ans=S-i
            break
        if n==N-1:
            ans=0
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,C=map(list,input().split())
print(['NO','YES'][A[-1]==B[0] and B[-1]==

Fixed submission:
A,B,C=map(list,input().split())
print(['NO','YES'][A[-1]==B[0] and B[-1]==C[0]])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(hoge) for hoge in input().split()]
ans = 1
cur = A[0]
Decided = A[0] != A[1]
Flat = A[0] == A[1]
Up = A[0] < A[1]
for n in range(1,N):
    if Decided:
        if (A[n]>=cur) == Up:#数列が続く
            cur = A[n]
        else:
            cur = A[n]
            Up = 1 -  Up
            Decided = False
            ans += 1
    else:
        if A[n] != cur:
            Up = A[n] > cur
            cur = A[n]
            Decided = True
print(ans)

Fixed submission:
N = int(input())
if N == 1:print(1);exit()
A = [int(hoge) for hoge in input().split()]
ans = 1
cur = A[0]
Decided = A[0] != A[1]
Flat = A[0] == A[1]
Up = A[0] < A[1]

for n in range(1,N):
    if Decided:
        if A[n] == cur:
            continue
        if (A[n]>=cur) == Up:#数列が続く
            cur = A[n]
        else:
            cur = A[n]
            Up = 1 - Up
            Decided = False
            ans += 1
    else:
        if A[n] != cur:
            Up = A[n] > cur
            cur = A[n]
            Decided = True
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input())
if a+c==2*b:print("YES")
else:print("NO")

Fixed submission:
a,b,c=map(int,input().split())
if a+c==2*b:print("YES")
else:print("NO")
Buggy python submission (verdict: Runtime Error):
H, W = [int(hoge) for hoge in input().split()]
print(Possible) if sum([input().count("#") for h in range(H)]) == H+W-1 else print(Impossible)

Fixed submission:
H, W = [int(hoge) for hoge in input().split()]
print("Possible") if sum([input().count("#") for h in range(H)]) == H+W-1 else print("Impossible")
Buggy python submission (verdict: Runtime Error):
W,H,N=list(map(int,input().split()))
ten=[list(map(int,input().split())) for _ in range(N)]
base=[[0,0,1],[0,0,3],[W,H,2],[W,H,4]]
ten.extend(base)
onemax=max(i[0] for i in ten if i[2]==1)
twomin=min(i[0] for i in ten if i[2]==2)
thrmax=max(i[1] for i in ten if i[2]==3)
foumin=min(i[1] for i in ten if i[2]==4)
if (twomin-onemax)>0 and (foumin-thrmax) >0:
    print((twomin-onemax)*(foumin-thrmax))
else:print(0)

Fixed submission:
ans=["No","Yes"]
candy=list(map(int,input().split()))
print(ans[sum(candy)/2 in candy])
Buggy python submission (verdict: Runtime Error):
[i for i in [a,b,h]=[int(input()) for i in range(3)]
print((a+b)*h/2)

Fixed submission:
[a,b,h]=[int(input()) for i in range(3)]
print((a+b)*h//2)
Buggy python submission (verdict: Runtime Error):
#x枚目まででy枚選んで合計がzになる場合の数dp[x][y][z]
N,A=map(int,input().split())
x=[int(i) for i in input().split()]
dp=[[[0]*(A*N+1) for i in range(N+1)]for k in range(N+2)]
ans=0
dp[0][0][0]=1
for made,i in enumerate(dp):
    if made>N:break
    for maisu,j in enumerate(i):
        for wa,k in enumerate(j):
            if k and made<=N:#made枚目までにmaisu枚選んでwaになる場合の数
                dp[made+1][maisu][wa]+=k
                newwa=wa+x[made-1]
                if newwa<=A*N:
                    dp[made+1][maisu+1][newwa]+=k
for mai in range(1,N+1):
    a=dp[N][mai][mai*A]
    if a:
        ans+=a
print(ans)


Fixed submission:
#x枚目まででy枚選んで合計がzになる場合の数dp[x][y][z](x+1*y+1*たくさん)
N,A=map(int,input().split())
x=[int(i) for i in input().split()]
dp=[[[0]*(50*N+1) for i in range(N+1)]for k in range(N+1)]
ans=0
dp[0][0][0]=1
for made,i in enumerate(dp):#走査して、一個上を書き換え
    if made>N:break
    for maisu,j in enumerate(i):
        for wa,k in enumerate(j):
            if k and made<N:#made枚目までにmaisu枚選んでwaになる場合の数
                dp[made+1][maisu][wa]+=k#made+1枚目についての議論
                newwa=wa+x[made]
                if newwa<=A*N:
                    dp[made+1][maisu+1][newwa]+=k
for mai in range(1,N+1):
    a=dp[N][mai][mai*A]
    if a:
        ans+=a
print(ans)

Buggy python submission (verdict: Runtime Error):
#x枚目まででy枚選んで合計がzになる場合の数dp[x][y][z]
N,A=map(int,input().split())
x=[int(i) for i in input().split()]
dp=[[[0]*(A*50) for i in range(N+2)]for k in range(N+2)]
ans=0
dp[0][0][0]=1
for made,i in enumerate(dp):
    if made>N:break
    for maisu,j in enumerate(i):
        for wa,k in enumerate(j):
            if k:#made枚目までにmaisu枚選んでwaになる場合の数
                dp[made+1][maisu][wa]+=k
                dp[made+1][maisu+1][wa+x[made-1]]+=k
for mai in range(1,N+1):
    a=dp[N][mai][mai*A]
    if a:
        ans+=a
print(ans)

Fixed submission:
#x枚目まででy枚選んで合計がzになる場合の数dp[x][y][z](x+1*y+1*たくさん)
N,A=map(int,input().split())
x=[int(i) for i in input().split()]
dp=[[[0]*(50*N+1) for i in range(N+1)]for k in range(N+1)]
ans=0
dp[0][0][0]=1
for made,i in enumerate(dp):#走査して、一個上を書き換え
    if made>N:break
    for maisu,j in enumerate(i):
        for wa,k in enumerate(j):
            if k and made<N:#made枚目までにmaisu枚選んでwaになる場合の数
                dp[made+1][maisu][wa]+=k#made+1枚目についての議論
                newwa=wa+x[made]
                if newwa<=A*N:
                    dp[made+1][maisu+1][newwa]+=k
for mai in range(1,N+1):
    a=dp[N][mai][mai*A]
    if a:
        ans+=a
print(ans)
Buggy python submission (verdict: Runtime Error):
#アンバランスな文字列からアンバランスでない文字列を取り除くと、
#アンバランスな文字列が残るはず。ということは、両側から文字を削り取ることで「どの部分列をとってもアンバランスな文字列」が存在するはず
#すなわちそれは、両側に「ax」が存在しない文字列で、「axa」または「aa...aa」
#aaがある時点でアンバランス確定なので「axa」「aa」のどちらかを探せばよし
import re
s=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
for i in alphabet:
    ba=s.find(i+i)
    if ba!=-1:
        print(str(ba+1)+str(ba+2))
        break
    A=re.compile(i+"."+i)
    axa=A.search(s,0)
    if axa:
        ba=axa.start())
        print(str(ba+1)+str(ba+3))
        break

Fixed submission:
#アンバランスな文字列からアンバランスでない文字列を取り除くと、
#アンバランスな文字列が残るはず。ということは、両側から文字を削り取ることで「どの部分列をとってもアンバランスな文字列」が存在するはず
#すなわちそれは、両側に「ax」が存在しない文字列で、「axa」または「aa...aa」
#aaがある時点でアンバランス確定なので「axa」「aa」のどちらかを探せばよし
import re
s=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
for i in alphabet:
    ba=s.find(i+i)
    if ba!=-1:
        print(str(ba+1)+" "+str(ba+2))
        break
    A=re.compile(i+"."+i)
    axa=A.search(s,0)
    if axa:
        ba=axa.start()
        print(str(ba+1)+" "+str(ba+3))
        break
    if i=="z":
        print("-1 -1")
Buggy python submission (verdict: Runtime Error):
feom collections import sqrt
if __name__=='__main__':
  n,d=[int(i) for i in input().split()]
  c=0
  for i in range(n):
    x,y = [int(i) for i in input().split()]
    if sqrt(x**2 + y**2) <= d:
      c+=1
  print(c)
    

Fixed submission:
from math import sqrt
if __name__=='__main__':
  n,d=[int(i) for i in input().split()]
  c=0
  for i in range(n):
    x,y = [int(i) for i in input().split()]
    if sqrt(x**2 + y**2) <= d:
      c+=1
  print(c)
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n >=30;
print('Yes')
else
print('No')

Fixed submission:
n = int(input())

if n >=30:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Runtime Error):
n=input().split()
x = n.find('0')

print(int(x)+1)

Fixed submission:
n=input()
nn=n.replace(' ','')
x = nn.find('0')

print(int(x)+1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
A,B,N=map(int,input().split())

ans=[]

for i in range(1,N+1):
  num= math.floor((A*i)/B)-(A*(math.floor(i/B)))
  ans.append(num)
 

ans.sort()

print(ans[-1])

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

if B >N:
  print(math.floor((A*N)/B))
else:
  print(math.floor((A*(B-1)/B)))
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())

if N % K ==0:
  print(0)
  exit()
  
ans = N
for i in range((N//K)+1):
  N = abs(N-K)
  ans =min(ans,N)
  
  
print(ans)

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

if N % K ==0:
  print(0)
  exit()
  
if N < K:
  print(min(N,K-N))
  exit()

if N > K:
  print(min(N%K,K-(N%K)))

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())

if N % K ==0:
  print(0)
  exit()
  
ans = N
num = N//K
for i in range(num+1):
  N = abs(N-K)
  ans =min(ans,N)
  
  
print(ans)

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

if N % K ==0:
  print(0)
  exit()
  
if N < K:
  print(min(N,K-N))
  exit()

if N > K:
  print(min(N%K,K-(N%K)))
Buggy python submission (verdict: Runtime Error):
a=[]

def dfs(x):
  if x>3234566667:
    return
  a.append(x)
  for i in range(10):
    if abs(x%10-i) <= 1:
      dfs(x%10+i)
      
for i in range(1,10):
  dfs(i)
a =sorted(a)
k=int(input())
print(a[k-1])

Fixed submission:
a = []

def dfs(x):
    if x > 3234566667:
        return
    a.append(x)
    for i in range(10):
        if abs(x%10-i) <= 1:
            dfs(x*10+i)

for i in range(1, 10):
    dfs(i)
a = sorted(a)
k = int(input())
print(a[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
ans=[]
i=0
while len(ans) < K:
  i += 1
  if len(str(i)) ==1:
    ans.append(i)
    continue
  x =0  
  for j in range(len(str(i))-1):
    if abs(int(str(i)[-(1+j)])-int(str(i)[-(2+j)])) >1:
      break
    elif abs(int(str(i)[-(1+j)])-int(str(i)[-(2+j)])) <=1:x +=1
    
  if x==(len(str(i))-1):
    ans.append(i)
  
print(ans[-1])

Fixed submission:
a = []

def dfs(x):
    if x > 3234566667:
        return
    a.append(x)
    for i in range(10):
        if abs(x%10-i) <= 1:
            dfs(x*10+i)

for i in range(1, 10):
    dfs(i)
a = sorted(a)
k = int(input())
print(a[k-1])
Buggy python submission (verdict: Runtime Error):
a,b,c = map(float,input().split())

if ((a**0.5) + (b**0.5))<(c**0.5):
  print("Yes")
else:
  print('No')


Fixed submission:
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(l[k-1])
Buggy python submission (verdict: Runtime Error):
import math
H,W = map(int,input().split())

if H==1 orW==1:
  print(1)
  exit()
  
x = H*W
if x % 2==0:
  print(x/2)
elif x% 2 ==1:
  print(int(math.ceil(x/2)+1))




Fixed submission:
import math
h,w = map(int,input().split())

x = h*w

if h==1 or w==1:
  print(1)
  exit()

if x%2==0:
  print(int(x/2))
else:
  print(int(math.ceil(x/2)))
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())

ans =[]

for i in range((n//(a+b)) + 1):
  for j in range(a):
    ans.append("b")
    continue
  
  for k in range(b):
    ans.append("r")
    continue
    

num =0   
for l in range(n):
  if ans[l] == "b":
    num += 1
  
  
  
print(num)

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

ans = n //(a+b)

if n%(a+b) >= a:
  ans2 = a
elif n%(a+b) <a:
  ans2 = n%(a+b)
  
  
print(ans*a+ans2)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())

ans =[]

for i in range(n):
  for j in range(a):
    ans.append("b")
    continue
  
  for k in range(b):
    ans.append("r")
    continue
    

num =0   
for l in range(n):
  if ans[l] == "b":
    num += 1
  
  
  
print(num)

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

ans = n //(a+b)

if n%(a+b) >= a:
  ans2 = a
elif n%(a+b) <a:
  ans2 = n%(a+b)
  
  
print(ans*a+ans2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(i) for i in input().split()]
x.sort()

ans = 10000
for p in range(1,x[-1]+1):
  sum =0
  for i in range(n):
    sum += (x[i]-p)**2
    
  ans = min(ans,sum)
  
print(ans) 

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

while k**i <= n:
  i +=1
  
print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(i) for i in input().split()]
x.sort()

ans = 100000000
for p in range(x[1],x[-1]+1):
  sum =0
  for i in range(n):
    sum += (x[i]-p)**2
    
  ans = min(ans,sum)
  
print(ans) 


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

ans = 1000000000
for p in range(1,101):
  sum =0
  for x in X:
    sum += (p-x)**2
    
  ans = min(ans,sum)
  
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(i) for i in input().split()]
x.sort()

ans = 10000
for p in range(x[1],x[-1]+1):
  sum =0
  for i in range(n):
    sum += (x[i]-p)**2
    
  ans = min(ans,sum)
  
print(ans) 


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

ans = 1000000000
for p in range(1,101):
  sum =0
  for x in X:
    sum += (p-x)**2
    
  ans = min(ans,sum)
  
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

a = [int(i) for i in range(N)]

x=[]
for i in range(N):

  if a[i] %2 ==0:
    x.append(a[i])
  
for i in x:
  if x[i] %3 ==0 or x[i] %5 ==0:
    print("APPROVED")
  else:
    print("DENIED")




Fixed submission:
N = int(input())

a = [int(i) for i in input().split()]
v=0
x=[]
j=0
for i in range(N):
  if a[i] %2 ==0:
    x.append(a[i])
    j +=1

    
for i in range(j):
  if x[i] %3 ==0 or x[i] %5 ==0:
    v += 1

if v == j:
  print("APPROVED")
else:
  print("DENIED")
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ps = [input().split() for i in range(m)]

ans =[]
for i in range(m):
  if not(ps[i][0] in ans) :
    ans += ps[i][0]
    

print(ps[0][0])
wa = 0
ac = 0
for i in ans:
  for j in range(m):
    #問題番号の確認
    w = 0
    if ps[j][0] == str(i):
      if ps[j][1] =="WA":
        w += 1
      elif ps[j][1] == "AC":
        ac += 1
        wa +=w
        break

    else:
      continue
      
      
print(ac,wa)

Fixed submission:
N,M = map(int, input().split())
ps = []
AC = [0]*N
WA = [0]*N
WA_sum = 0
for _ in range(M):
  ps.append(list(input().split()))
for i in range(M):
  if ps[i][1] == 'AC' and AC[int(ps[i][0])-1] == 0:
    AC[int(ps[i][0])-1] = 1
  if ps[i][1] == 'WA' and AC[int(ps[i][0])-1] == 0:
    WA[int(ps[i][0])-1] += 1
for i in range(N):
  if AC[i] == 1:
    WA_sum += int(WA[i])
print(sum(AC), WA_sum)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int,input().split())

for i in range(K):
  if A > 0:
    A -= 1
    continue
  
  if A ==0 and B > 0:
    B -= 1
    continue
  
  else:
    continue
    
print(A,B)
  
 

Fixed submission:
a, b, k = [int(x) for x in input().split(" ")]

if a + b == k or a + b < k or (a == 0 and b == 0):
  print(0, 0)
elif a + b > k and a >= k:
  print(a-k, b)
elif a + b > k and a < k:
  print(0, a+b-k)
Buggy python submission (verdict: Runtime Error):
S = input()

num = 0

for i in range(len(S)):
  if not(S[i] == S[-(1+i)]):
    S[i] = S[-1+i]
    num +=1
    
print(num)
  

Fixed submission:
S = input()

num = 0

for i in range(len(S)):
  if not(S[i] == S[-(1+i)]):
    
    num +=1
    
print(int(num/2))
Buggy python submission (verdict: Runtime Error):
N =int(input())

if N !=0 and N <10:
  print("Yes")
  exit()

for i in range(2:10):
  if N % i ==0:
    print("Yes")


    
print("No")

Fixed submission:
list = []

for i in range(1, 10):
  for j in range(1, 10):
    list.append(i * j)

N = int(input())

if N in list:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
from itertools import groupby
N = int(input())
S = input()
G = groupby(S)
print(len(G))

Fixed submission:
from itertools import groupby
N = int(input())
S = input()
G = groupby(S)
print(len(list(G)))
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())

h = [int(i) for i in input().split()]

count =0

for i in range(N):
  if h[i] >= k:
    count += 1
    
    
print(count)
    

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

h = [int(i) for i in input().split()]

count =0

for i in range(N):
  if h[i] >= K:
    count += 1
    
    
print(count)
Buggy python submission (verdict: Runtime Error):
S = input()

odd = list(S[::2])
even = list(S[1::2])
xx = "No"
x1 = ""
x2 = ""

for i in range(len(odd)):
  check = 0
  if odd[i] == "L" or "U" or "D":
    check += 1
  
if check == len(odd):
  x1 = "Y"
  
for i in range(len(even)):
  check2 = 0
  if even[i] == "R" or "U" or "D":
    check2 += 1
 
if check2 == len(even):
  x2 = "Y"
  
  
if x1 and x2 == "Y":
  xx = "Yes"
  
  
print(xx)



Fixed submission:
s = input()

if 'L' in s[::2] or 'R' in s[1::2]:
    ans = 'No'
else:
    ans = 'Yes'
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())

c = B % A
if A >= B:
  print(1)
  exit()
  
elif c = 0:
  print( B//A)
  
elif c >0:
  print((B//A) + 1)

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

print((b - 1 + (a - 2)) // (a - 1))
Buggy python submission (verdict: Runtime Error):
N = int(input)
A = [float(i) for i in input().split()]

c = 0

for i in A:
  c += (1/A[i])

print(float(1/c))


Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

c = 0

for i in range(N):
  c += (1/A[i])

print(float(1/c))

Buggy python submission (verdict: Runtime Error):
N = int(input)
A = [int(i) for i in input().split()]

c = 0

for i in A:
  c += (1/A[i])

print(float(1/c))

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]

c = 0

for i in range(N):
  c += (1/A[i])

print(float(1/c))
Buggy python submission (verdict: Runtime Error):
n = int(input())
plst = list(map(int,input().split()))
plst_sort = sorted(plst)
cnt = 0
for i in range(N):
    if plst[i] != plst_sort[i]:
        cnt += 1
if cnt == 2 or cnt == 0:
    print("YES")
else:
    print("NO")


Fixed submission:
n = int(input())
plst = list(map(int,input().split()))
plst_sort = sorted(plst)
cnt = 0
for i in range(len(plst)):
    if plst[i] != plst_sort[i]:
        cnt += 1
if cnt == 2 or cnt == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s =input()
print("Bad" if any(S[i]==S[i+1] for i in range(3)) else "Good")

Fixed submission:
s = input()

print("Bad" if any(s[i]==s[i+1] for i in range(3)) else "Good")
Buggy python submission (verdict: Runtime Error):
N,X = map(int,input().split())

L = [int(i) for i in range(N)]

D =[]
D[0]=0

for i in range(N):
  x += L[i]
  D.append(x)
  
  
print(D)

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

L = [int(i) for i in input().split()]

D =[]
D.append(0)
x = 0

for i in range(N):
  x += L[i]
  D.append(x)
  
ans = 0

for i in range(N+1):
  
  if D[i] <= X:
    ans += 1

print(ans)
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
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    if i in a:dp[i]=0
print(dp[n])

Fixed submission:

n,m=map(int,input().split())
a=set([int(input()) for i in range(m)])
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    if i in a:dp[i]=0
print(dp[n])