Buggy python submission (verdict: Runtime Error):
import fractions
import numpy as np
import math
 
N, M = map(int, input().split())
a = np.array(list(map(int, input().split()))) // 2
 
def lcm(a, b):
    return a * b // fractions.gcd(a, b)
    
def check_two(num):
    count = 0
    while num % 2 == 0:
        num //= 2
        count += 1
    return count

two_num = check_two(a[0])
for i in range(1, len(a)):
    if two_num != check_two(a[i]):
        print(0)
        exit()
 
my_lcm = lcm(a[0], a[1])
for i in range(2, len(a)):
    my_lcm = lcm(my_lcm, a[i])
    if my_lcm > N:
        print(0)
        exit()
    
ans = M // my_lcm
print(math.ceil(ans / 2))

Fixed submission:
import fractions
import math
 
N, M = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]
 
def lcm(a, b):
    return a * b // fractions.gcd(a, b)
    
def check_two(num):
    count = 0
    while num % 2 == 0:
        num //= 2
        count += 1
    return count

two_num = check_two(a[0])

for i in range(1, len(a)):
    if two_num != check_two(a[i]):
        print(0)
        exit()
 
my_lcm = a[0]
for i in range(1, len(a)):
    my_lcm = lcm(my_lcm, a[i])
    if my_lcm > M:
        print(0)
        exit()
    
ans = M // my_lcm
print(math.ceil(ans / 2))

Buggy python submission (verdict: Runtime Error):
import fractions
import numpy as np
import math

N, M = map(int, input().split())
a = np.array(list(map(int, input().split()))) // 2

def lcm(a, b):
    return a * b // fractions.gcd(a, b)
    
def check_two(num):
    count = 0
    while num % 2 == 0:
        num //= 2
        count += 1
    return count

two_nums = [check_two(i) for i in a]
if len(set(two_nums)) > 1:
    print(0)
    exit()

my_lcm = lcm(a[0], a[1])
for i in range(2, len(a)):
    my_lcm = lcm(my_lcm, a[i])
    if my_lcm > N:
        print(0)
        exit()
    
ans = M // my_lcm
print(math.ceil(ans / 2))

Fixed submission:
import fractions
import math
 
N, M = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]
 
def lcm(a, b):
    return a * b // fractions.gcd(a, b)
    
def check_two(num):
    count = 0
    while num % 2 == 0:
        num //= 2
        count += 1
    return count

two_num = check_two(a[0])

for i in range(1, len(a)):
    if two_num != check_two(a[i]):
        print(0)
        exit()
 
my_lcm = a[0]
for i in range(1, len(a)):
    my_lcm = lcm(my_lcm, a[i])
    if my_lcm > M:
        print(0)
        exit()
    
ans = M // my_lcm
print(math.ceil(ans / 2))

Buggy python submission (verdict: Runtime Error):
import fractions
import numpy as np
import math

N, M = map(int, input().split())
a = np.array(list(map(int, input().split()))) / 2

def lcm(a, b):
    return a * b / fractions.gcd(a, b)
    
def check_two(num):
    count = 0
    while num % 2 == 0:
        num /= 2
        count += 1
    return count

two_nums = [check_two(i) for i in a]
if len(set(two_nums)) > 1:
    print(0)
    exit()

my_lcm = lcm(a[0], a[1])
for i in range(2, len(a)):
    my_lcm = lcm(my_lcm, a[i])
    if my_lcm > N:
        print(0)
        exit()
    
ans = M // my_lcm
print(math.ceil(ans / 2))

Fixed submission:
import fractions
import math
 
N, M = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]
 
def lcm(a, b):
    return a * b // fractions.gcd(a, b)
    
def check_two(num):
    count = 0
    while num % 2 == 0:
        num //= 2
        count += 1
    return count

two_num = check_two(a[0])

for i in range(1, len(a)):
    if two_num != check_two(a[i]):
        print(0)
        exit()
 
my_lcm = a[0]
for i in range(1, len(a)):
    my_lcm = lcm(my_lcm, a[i])
    if my_lcm > M:
        print(0)
        exit()
    
ans = M // my_lcm
print(math.ceil(ans / 2))

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
import numpy as np
import math

N, M = map(int, input().split())
a = np.array(list(map(int, input().split()))) / 2
a = np.array(list(set(a)))

def lcm(a, b):
    return a * b / gcd(a, b)
    
def check_two(num):
    count = 0
    while num % 2 == 0:
        num /= 2
        count += 1
    return count

two_nums = [check_two(i) for i in a]
if len(set(two_nums)) > 1:
    print(0)
    exit()

lcm = lcm(a[0], a[1])
for i in range(2, len(a)):
    lcm = lcm(lcm, a[i])
    if lcm > N:
        print(0)
        exit()
    
ans = M // lcm
print(math.ceil(ans / 2))

Fixed submission:
import fractions
import math
 
N, M = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]
 
def lcm(a, b):
    return a * b // fractions.gcd(a, b)
    
def check_two(num):
    count = 0
    while num % 2 == 0:
        num //= 2
        count += 1
    return count

two_num = check_two(a[0])

for i in range(1, len(a)):
    if two_num != check_two(a[i]):
        print(0)
        exit()
 
my_lcm = a[0]
for i in range(1, len(a)):
    my_lcm = lcm(my_lcm, a[i])
    if my_lcm > M:
        print(0)
        exit()
    
ans = M // my_lcm
print(math.ceil(ans / 2))