Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

dp=[-1 for _ in range(N+1)]
def Lu(n):
    if n==0:
        rec=2
    elif n==1:
        rec=1
    elif dp[n]!=-1:
        return dp[n]
    else:
        return Lu(n-1)+Lu(n-2)
    dp[n]=rec
    return rec
print(Lu(N))


Fixed submission:
N=int(input())

dp=[-1 for _ in range(N+1)]
def Lu(n):
    if n==0:
        rec=2
    elif n==1:
        rec=1
    elif dp[n]!=-1:
        return dp[n]
    else:
        rec=Lu(n-1)+Lu(n-2)
    dp[n]=rec
    return rec
print(Lu(N))

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

def Lu(n):
    if n==0:
        return 2
    elif n==1:
        return 1
    else:
        return Lu(n-1)+Lu(n-2)
print(Lu(N))


Fixed submission:
N=int(input())

dp=[-1 for _ in range(N+1)]
def Lu(n):
    if n==0:
        rec=2
    elif n==1:
        rec=1
    elif dp[n]!=-1:
        return dp[n]
    else:
        rec=Lu(n-1)+Lu(n-2)
    dp[n]=rec
    return rec
print(Lu(N))
Buggy python submission (verdict: Runtime Error):
ABCD=list(map(int, list(input())))
for i in range(1<<3):
    tmp=list(map(int, list(str(bin(i))[2:].zfill(3))))
    a=ABCD[0]
    for j in range(3):
        if tmp[j]:
            a+=ABCD[j+1]
        else:
            a-=ABCD[j+1]
    if a==7:
        print(ABCD[0], end="")
        for j in range(3):
            print("+" if tmp[j] else "-", end="")
            print(ABCD[j+1], end="")
        print("=7")
        exit(1)


Fixed submission:
ABCD=list(map(int, list(input())))
for i in range(1<<3):
    tmp=list(map(int, list(str(bin(i))[2:].zfill(3))))
    a=ABCD[0]
    for j in range(3):
        if tmp[j]:
            a+=ABCD[j+1]
        else:
            a-=ABCD[j+1]
    if a==7:
        print(ABCD[0], end="")
        for j in range(3):
            print("+" if tmp[j] else "-", end="")
            print(ABCD[j+1], end="")
        print("=7")
        exit(0)

Buggy python submission (verdict: Runtime Error):
ABCD=list(map(int, list(input())))
for i in range(1<<3):
    tmp=list(map(int, list(str(bin(i))[2:].zfill(3))))
    print(tmp)
    a=ABCD[0]
    for j in range(3):
        if tmp[j]:
            a+=ABCD[j+1]
        else:
            a-=ABCD[j+1]
    if a==7:
        print(ABCD[0], end="")
        for j in range(3):
            print("+" if tmp[j] else "-", end="")
            print(ABCD[j+1], end="")
        print("=7")
        exit(1)


Fixed submission:
ABCD=list(map(int, list(input())))
for i in range(1<<3):
    tmp=list(map(int, list(str(bin(i))[2:].zfill(3))))
    a=ABCD[0]
    for j in range(3):
        if tmp[j]:
            a+=ABCD[j+1]
        else:
            a-=ABCD[j+1]
    if a==7:
        print(ABCD[0], end="")
        for j in range(3):
            print("+" if tmp[j] else "-", end="")
            print(ABCD[j+1], end="")
        print("=7")
        exit(0)
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()))

def binary_search(list,target,b):
    left = 0
    right = len(list) - 1

    while left <= right:
        center = (left + right)//2
        if list[center] == target:
            if b:
                while list[center]==target:
                    center+=1
            return center
        elif list[center] < target:
            left = center + 1
        elif list[center] > target:
            right = center - 1

    if list[center]<target:
        center+=1
    return center

A.sort()
C.sort()
ans=0
for b in B:
    ans+=binary_search(A,b,0)*(len(C)-binary_search(C,b,1))
print(ans)


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

A.sort()
C.sort()
ans=0
for b in B:
    ans+=bisect.bisect_left(A,b)*(len(C)-bisect.bisect_right(C,b))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
C=list(map(int, input().split()))

def binary_search(list,target,b):
    left = 0
    right = len(list) - 1

    while left <= right:
        center = (left + right)//2
        if list[center] == target:
            return center+B.count(target) if b else center
        elif list[center] < target:
            left = center + 1
        elif list[center] > target:
            right = center - 1

    if list[center]<target:
        center+=1
    return center

A.sort()
C.sort()
ans=0
for b in B:
    ans+=binary_search(A,b,0)*(len(C)-binary_search(C,b,1))
print(ans)


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

A.sort()
C.sort()
ans=0
for b in B:
    ans+=bisect.bisect_left(A,b)*(len(C)-bisect.bisect_right(C,b))
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C, D, E, F=map(int, input().split())
a=[[0,0]]
for i in range(101):
    for j in range(101):
        for k in range(101):
            for l in range(101):
                x=100*A*i+100*B*j
                y=C*k+D*l
                if x+y>F or x==0 or y==0:
                    break
                if 100*y/(x+y)<=(E*100)/(100+E):
                    a.append([str(x+y),str(y)])
print(' '.join(sorted(a, key=lambda x: (100*int(x[1]))/int(x[0]) if int(x[0])!=0 else 0)[-1]))


Fixed submission:
A, B, C, D, E, F=map(int, input().split())
a=[[str(100*A),'0']]
for i in range(101):
    for j in range(101):
        for k in range(101):
            for l in range(101):
                x=100*A*i+100*B*j
                y=C*k+D*l
                if x+y>F or x==0:
                    break
                if 100*y/(x+y)<=(E*100)/(100+E):
                    a.append([str(x+y),str(y)])
print(' '.join(sorted(a, key=lambda x: (100*int(x[1]))/int(x[0]) if int(x[0])!=0 else 0)[-1]))

Buggy python submission (verdict: Runtime Error):
A, B, C, D, E, F=map(int, input().split())
a=[]
for i in range(101):
    for j in range(101):
        for k in range(101):
            for l in range(101):
                x=100*A*i+100*B*j
                y=C*k+D*l
                if x+y>F or x==0 or y==0:
                    break
                if 100*y/(x+y)<=(E*100)/(100+E):
                    a.append([str(x+y),str(y)])
print(' '.join(sorted(a, key=lambda x: (100*int(x[1]))/int(x[0]) if int(x[0])!=0 else 0)[-1]))


Fixed submission:
A, B, C, D, E, F=map(int, input().split())
a=[[str(100*A),'0']]
for i in range(101):
    for j in range(101):
        for k in range(101):
            for l in range(101):
                x=100*A*i+100*B*j
                y=C*k+D*l
                if x+y>F or x==0:
                    break
                if 100*y/(x+y)<=(E*100)/(100+E):
                    a.append([str(x+y),str(y)])
print(' '.join(sorted(a, key=lambda x: (100*int(x[1]))/int(x[0]) if int(x[0])!=0 else 0)[-1]))

Buggy python submission (verdict: Runtime Error):
A, B, C, D, E, F=map(int, input().split())
a=[]
for i in range(101):
    for j in range(101):
        for k in range(101):
            for l in range(101):
                x=100*A*i+100*B*j
                y=C*k+D*l
                if x+y>F or x==0 or y==0:
                    break
                if 100*y//(x+y)<=(E*100)/(100+E):
                    a.append([str(x+y),str(y)])
print(' '.join(sorted(a, key=lambda x: (100*int(x[1]))/int(x[0]) if int(x[0])!=0 else 0)[-1]))


Fixed submission:
A, B, C, D, E, F=map(int, input().split())
a=[[str(100*A),'0']]
for i in range(101):
    for j in range(101):
        for k in range(101):
            for l in range(101):
                x=100*A*i+100*B*j
                y=C*k+D*l
                if x+y>F or x==0:
                    break
                if 100*y/(x+y)<=(E*100)/(100+E):
                    a.append([str(x+y),str(y)])
print(' '.join(sorted(a, key=lambda x: (100*int(x[1]))/int(x[0]) if int(x[0])!=0 else 0)[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for _ in range(N)]
B=list(set(A))
ct=0
for i in range(len(B)):
    if A.count(B[i])%2==0:
        ct+=1
print(len(B)-ct)


Fixed submission:
from collections import Counter
N=int(input())
A=[int(input()) for _ in range(N)]
X=Counter(A)
ans=0
for i in X.values():
    if i%2==1:
        ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for _ in range(N)]
B=[]
for i in range(N):
    if A[i] not in B:
        B.append(A[i])
    else:
        B.remove(A[i])
print(len(B))


Fixed submission:
from collections import Counter
N=int(input())
A=[int(input()) for _ in range(N)]
X=Counter(A)
ans=0
for i in X.values():
    if i%2==1:
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N-1):
    if q[i]=='x':
        if i<n-1:
            p[i], p[i+1]=p[i+1], p[i]
        else:
            p[i], p[i-a1]=p[i-1], p[i]
        q[i]='o'
        q[i+1]='o'
        ans+=1

print(ans)


Fixed submission:
from collections import Counter
N=int(input())
a=list(map(int, input().split()))
b=[]
for i in range(N):
    b.append(a[i])
    b.append(a[i]+1)
    b.append(a[i]-1)
Ctb=Counter(b)
print(max(Ctb.values()))
Buggy python submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N):
    if q[i]=='x':
        if i<N-1:
            p[i], p[i+1]=p[i+1], p[i]
            q[i+1]='o'
        else:
            p[i], p[i-1]=p[i-1], p[i]
            q[i-1]='o'
        q[i]='o'
        q[i+1]='o'
        ans+=1

print(ans)


Fixed submission:
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N):
    if q[i]=='x':
        if i<N-1:
            p[i], p[i+1]=p[i+1], p[i]
            q[i+1]='o'
        else:
            p[i], p[i-1]=p[i-1], p[i]
            q[i-1]='o'
        q[i]='o'
        ans+=1

print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N):
    if q[i]=='x':
        if i<N-1:
            p[i], p[i+1]=p[i+1], p[i]
        else:
            p[i], p[i-1]=p[i-1], p[i]
        q[i]='o'
        q[i+1]='o'
        ans+=1

print(ans)


Fixed submission:
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N):
    if q[i]=='x':
        if i<N-1:
            p[i], p[i+1]=p[i+1], p[i]
            q[i+1]='o'
        else:
            p[i], p[i-1]=p[i-1], p[i]
            q[i-1]='o'
        q[i]='o'
        ans+=1

print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N):
    if q[i]=='x':
        if i<N-1:
            p[i], p[i+1]=p[i+1], p[i]
        else:
            p[i], p[i-a1]=p[i-1], p[i]
        q[i]='o'
        q[i+1]='o'
        ans+=1

print(ans)


Fixed submission:
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N):
    if q[i]=='x':
        if i<N-1:
            p[i], p[i+1]=p[i+1], p[i]
            q[i+1]='o'
        else:
            p[i], p[i-1]=p[i-1], p[i]
            q[i-1]='o'
        q[i]='o'
        ans+=1

print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N-1):
    if q[i]=='x':
        if i<n-1:
            p[i], p[i+1]=p[i+1], p[i]
        else:
            p[i], p[i-a1]=p[i-1], p[i]
        q[i]='o'
        q[i+1]='o'
        ans+=1

print(ans)


Fixed submission:
N=int(input())
p=list(map(int,input().split()))
q=['x' for _ in range(N)]
ans=0
for i in range(N):
    if p[i]!=i+1:
        q[i]='o'
for i in range(N):
    if q[i]=='x':
        if i<N-1:
            p[i], p[i+1]=p[i+1], p[i]
            q[i+1]='o'
        else:
            p[i], p[i-1]=p[i-1], p[i]
            q[i-1]='o'
        q[i]='o'
        ans+=1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(M)]

s=[]
g=[]
for i, j in ab:
    if i==1:
        s.append(j)
    elif j==1:
        s.append(i)
    elif i==N:
        g.append(j)
    elif j==N:
        g.append(i)
flag=0
for i in range(len(s)):
    if s[i] in g:
        flag=1
        break

print("POSSIBLE"  if flag else "IMPOSSIBLE")


Fixed submission:
N, M=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(M)]
b=set()
for i,j in ab:
    if i==1 or j==N:
        b.add((i,j))
print("IM"*(not(any(((1,i) in b and (i,N) in b) for i in range(N))))+"POSSIBLE")

Buggy python submission (verdict: Time Limit Exceeded):
N, M=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(M)]

s=[]
g=[]
for i, j in ab:
    if i==1:
        s.append(j)
    elif j==1:
        s.append(i)
    elif i==N:
        g.append(j)
    elif j==N:
        g.append(i)
flag=0
for i in range(len(s)):
    for j in range(len(g)):
        if s[i]==g[j]:
            flag=1

print("POSSIBLE"  if flag else "IMPOSSIBLE")


Fixed submission:
N, M=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(M)]
b=set()
for i,j in ab:
    if i==1 or j==N:
        b.add((i,j))
print("IM"*(not(any(((1,i) in b and (i,N) in b) for i in range(N))))+"POSSIBLE")
Buggy python submission (verdict: Runtime Error):
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	a,b = max(a,b), min(a,b)
	while b:
		a,b=b,a%b
	return a

if K>max(A):
	print("IMPOSSIBLE")
	exit(0)

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")

Fixed submission:
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

if K>max(A):
	print("IMPOSSIBLE")
	exit(0)

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")

Fixed submission:
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), returned=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

if K>max(A):
	print("IMPOSSIBLE")
	exit(0)

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")

Fixed submission:
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split()))))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

Fixed submission:
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
N, K=map(int, input().split())
A=list(map(int, input().split()))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")

Fixed submission:
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
print('Possible' for (A+B)%3==0 or A%3==0 or B%3==0 else 'Impossible')


Fixed submission:
A,B=map(int,input().split())
print('Possible' if (A+B)%3==0 or A%3==0 or B%3==0 else 'Impossible')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(250010)
N,M=map(int, input().split())
def func(n):
    if n==1:
        return 1
    return n*func(n-1)

if N==M:
    print((func(N)*func(M)*2)%(10**9+7))
elif N==M-1 or M==N-1:
    print((func(N)*func(M))%(10**9+7))
else:
    print(0)


Fixed submission:
N,M=map(int, input().split())
mod=1000000000+7
fact=[1]*100001
for i in range(100000):
    fact[i+1]=fact[i]*(i+1)%mod

if N==M:
    print((fact[N]*fact[M]*2)%mod)
elif abs(N-M)==1:
    print((fact[N]*fact[M])%mod)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
r,g,b=map(int, input().split())
rgb=str(r)+str(g)+str(b)
print("YES" if rgb%4==0 else "NO")


Fixed submission:
r,g,b=map(int, input().split())
rgb=str(r)+str(g)+str(b)
print("YES" if int(rgb)%4==0 else "NO")
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=map(int, input().split())
print(max(A)-min(A))


Fixed submission:
N=int(input())
A=list(map(int, input().split()))
print(max(A)-min(A))
Buggy python submission (verdict: Runtime Error):
A,B,C=map(int, input().split())
print("Yes" if A<=C<=B else'No)


Fixed submission:
A,B,C=map(int, input().split())
print("Yes" if A<=C<=B else'No')
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a=='H':
    print('H' if b=='H' else 'D')
else:
    print('D' if b=='H' else 'H')


Fixed submission:
a,b=input().split()
if a=='H':
    print('H' if b=='H' else 'D')
else:
    print('D' if b=='H' else 'H')
Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        t=[k[j:j*m] for k in a[i:i+m]]
        if t==B:
            print('Yes')
            exit()
print('No')


Fixed submission:
A,B=map(int, input().split())
if A==1:
    A=14
if B==1:
    B=14
if A>B:
    print('Alice')
elif A==B:
    print('Draw')
else:
    print('Bob')
Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        t=[k[j:j+m] for k in a[i:i+m]]
        if t==B:
            print('Yes')
            exit()
print('No')


Fixed submission:
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        t=[k[j:j+M] for k in A[i:i+M]]
        if t==B:
            print('Yes')
            exit()
print('No')

Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        t=[k[j:j*m] for k in a[i:i+m]]
        if t==B:
            print('Yes')
            exit()
print('No')


Fixed submission:
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        t=[k[j:j+M] for k in A[i:i+M]]
        if t==B:
            print('Yes')
            exit()
print('No')

Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N):
    if B[0] in A[i]:
        if all(B[j] in A[i+j] for j in range(1,min(M,N-i)):
            print('Yes')
            exit(0)
print('No')


Fixed submission:
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        t=[k[j:j+M] for k in A[i:i+M]]
        if t==B:
            print('Yes')
            exit()
print('No')

Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N):
    if B[0] in A[i]:
        if all(B[j] in A[i+j] for j in range(1,M)):
            print('Yes')
            exit(0)
print('No')


Fixed submission:
N,M=map(int, input().split())
A=[input() for _ in range(N)]
B=[input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        t=[k[j:j+M] for k in A[i:i+M]]
        if t==B:
            print('Yes')
            exit()
print('No')
Buggy python submission (verdict: Runtime Error):
print('ABC' if x<1200 else 'ARC')


Fixed submission:
print('ABC' if int(input())<1200 else 'ARC')
Buggy python submission (verdict: Runtime Error):
グリコ森永事件【完全永久保存版】

Fixed submission:
vowel=['a','i','u','e','o']
print('vowel' if input() in vowel else 'consonant')
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
TA=[list(map(int, input().split())) for _ in range(N)]
ls=[[TA[0][0],TA[0][1]]]
for i in range(1,N):
    tmp=[TA[i][0],TA[i][1]]
    j=2
    while 1:
        if tmp[0]>=ls[-1][0] and tmp[1]>=ls[-1][1]:
            break
        tmp[0]=TA[i][0]*j
        tmp[1]=TA[i][1]*j
        j+=1
    ls.append([tmp[0],tmp[1]])
print(ls[-1][0]+ls[-1][1])


Fixed submission:
N=int(input())
TA=[list(map(int, input().split())) for _ in range(N)]
ls=[[TA[0][0],TA[0][1]]]
for i in range(1,N):
    tmp=[TA[i][0],TA[i][1]]
    a=max(-(ls[-1][0]//(-tmp[0])),-(ls[-1][1]//(-tmp[1])))
    tmp[0]*=a
    tmp[1]*=a
    ls.append([tmp[0],tmp[1]])
print(ls[-1][0]+ls[-1][1])
Buggy python submission (verdict: Runtime Error):
sabc=[list(input()) for _ in range(3)]
abc=[0,0,0]
lsabc=['a','b','c']
lsABC=['A','B','C']
def func(n):
    num=lsabc.index(sabc[n][abc[n]])
    abc[num]+=1
    if abc[num]==len(sabc[num])-1:
        print(lsABC[num])
        exit()
    func(num)
func(0)


Fixed submission:
sabc=[list(input()) for _ in range(3)]
abc=[0,0,0]
lsabc=['a','b','c']
lsABC=['A','B','C']
def func(turn):
    if abc[turn]==len(sabc[turn]):
        print(lsABC[turn])
        exit()
    next=lsabc.index(sabc[turn][abc[turn]])
    abc[turn]+=1
    func(next)
func(0)
Buggy python submission (verdict: Runtime Error):
N=input()
print(N*(N+1)//2)


Fixed submission:
N=int(input())
print(N*(N+1)//2)