Buggy python submission (verdict: Runtime Error):
import fractions
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

ma = 0
is2 = False
for i in range(n):
    if a[i] == 2:
        is2 = True
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]

l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

if is2 and l % 2 == 0:
    print(0)
    return

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)


Fixed submission:
import fractions
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

ma = 0
mod2count = -1
for i in range(n):
    if mod2count == -1:
        mod2count = bin(a[i])[2:][::-1].find('1')
    if mod2count != bin(a[i])[2:][::-1].find('1'):
        print(0)
        exit()
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]

l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)

Buggy python submission (verdict: Runtime Error):
import math
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

ma = 0
for i in range(n):
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]
l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)


Fixed submission:
import fractions
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

ma = 0
mod2count = -1
for i in range(n):
    if mod2count == -1:
        mod2count = bin(a[i])[2:][::-1].find('1')
    if mod2count != bin(a[i])[2:][::-1].find('1'):
        print(0)
        exit()
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]

l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)

Buggy python submission (verdict: Runtime Error):
import math
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

ma = 0
for i in range(n):
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]
l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])
ans = ((m - ma) // (l * 3))
if (m - ma) // l // 2 == 0:
    print(0)
else:
    print((m - ma) // l // 2 + 1)


Fixed submission:
import fractions
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

ma = 0
mod2count = -1
for i in range(n):
    if mod2count == -1:
        mod2count = bin(a[i])[2:][::-1].find('1')
    if mod2count != bin(a[i])[2:][::-1].find('1'):
        print(0)
        exit()
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]

l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)

Buggy python submission (verdict: Runtime Error):
import math
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

ma = 0
for i in range(n):
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]
l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])
ans = ((m - ma) // (l * 3))
if (m - ma) // l // 2 == 0:
    print(0)
else:
    print((m - ma) // l // 2 + 1)


Fixed submission:
import fractions
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

ma = 0
mod2count = -1
for i in range(n):
    if mod2count == -1:
        mod2count = bin(a[i])[2:][::-1].find('1')
    if mod2count != bin(a[i])[2:][::-1].find('1'):
        print(0)
        exit()
    a[i] = a[i] // 2
    if a[i] > ma:
        ma = a[i]

l = a[0]
for i in range(1, n):
    l = lcm(l, a[i])

tmp = m // l
if tmp % 2 == 0:
    print(tmp // 2)
else:
    print(tmp // 2 + 1)