Buggy python submission (verdict: Runtime Error):
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
a = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l

print(ans)

Fixed submission:
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
s = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l

print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
s = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (M + l // 2) // l

print(ans)

Fixed submission:
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
s = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l

print(ans)

Buggy python submission (verdict: Runtime Error):
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
g = a[0]
for i in a:
    g = g * i // fractions.gcd(g,i)
if g/2 > m:
    print(0)
else:
    print((m + g // 2) // g)

Fixed submission:
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
s = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l

print(ans)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
a = set(a)
g = 1
for i in a:
    g *= i // gcd(g,i)
if g * 0.5 > m:
    print(0)
else:
    print(math.floor((m / (g/2) + 1) / 2))

Fixed submission:
import fractions
import math
n,m = map(int,input().split())
a = list(map(int, input().split()))
s = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l,i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i>>count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l

print(ans)