Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
m = max(A)
A.remove(m)
base = 0
for i in range(m,M+1,2*m):
	semi = True
	for j in A:
		if i % j != 0 or (i // j) % 2 == 0:
			semi = False
			break
	if semi:
		base = i
		break
if base == 0:
	print(0)
else:
	print(((M // base) + 1)//2)

Fixed submission:
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
m = max(A)
A.remove(m)
base = 0
for i in range(m,M+1,2*m):
	semi = True
	for j in A:
		if i not in range(j,M+1,2*j):
			semi = False
			break
	if semi:
		base = i
		break
if base == 0:
	print(0)
else:
	print(((M // base) + 1)//2)

Fixed submission:
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = list(i//2 for i in map(int, input().split()))
m = max(A)
A.remove(m)
base = 0
for i in range(m,M+1,2*m):
	semi = True
	for j in A:
		if i not in range(j,M+1,2*j):
			semi = False
			break
	if semi:
		base = i
		break
if base == 0:
	print(0)
else:
	print(((M // base) + 1)//2)

Fixed submission:
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(int(i/2) for i in map(int, input().split()))
m = max(A)
A.remove(m)

for i in range(m,M+1,2*m):
	semi = True
	for j in A:
		if i not in range(j,M+1,2*j):
			semi = False
			break
	if semi:
		base = i
		break

print(int(((M // base) + 1)/2))

Fixed submission:
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(list(range(int(i/2),M+1,2*int(i/2))) for i in map(int, input().split()))
P = set(A[0]).intersection(*A[1:])
print(len(P))

Fixed submission:
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = list(int(i/2) for i in map(int, input().split()))
m = max(A)
A.remove(m)
cnt = 0
for i in range(m,M+1,2*m):
	semi = True
	for j in A:
		if i not in range(j,M+1,2*j):
			semi = False
			break
	if semi:
		cnt += 1

print(cnt)

Fixed submission:
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
A = list(int(i/2) for i in map(int, input().split()))
A.sort(reverse = True)
m = max(A)
A.remove(m)
cnt = 0
for i in range(m,M+1,2*m):
	semi = True
	for j in A:
		if i % j != 0 or (i // j) % 2 == 0:
			semi = False
	if semi:
		cnt += 1

print(cnt)

Fixed submission:
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)

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

cnt = 0
for i in range(M):
	semi = True
	for j in A:
		if ((i+1) * 2 / j) % 2 != 1:
			semi = False
			break
	if semi:
		cnt += 1

print(cnt)

Fixed submission:
N, M = map(int, input().split())
A = set(i//2 for i in map(int, input().split()))
B = []
for i in A:
	B = B + [0]
	while i % 2 == 0:
		i //= 2
		B[-1] += 1
if len(set(B)) == 1:
	m = max(A)
	A.remove(m)
	base = 0
	for i in range(m,M+1,2*m):
		semi = True
		for j in A:
			if i % j != 0 or (i // j) % 2 == 0:
				semi = False
				break
		if semi:
			base = i
			break
	if base == 0:
		print(0)
	else:
		print(((M // base) + 1)//2)
else:
	print(0)