Buggy python submission (verdict: Runtime Error):
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in a:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
sum = 0
for i in a:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  ans = 0
print(ans)


Fixed submission:
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in range(0,len(a)):
  lcm = (lcm * a[i]) // gcd(lcm,a[i])

ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
sum = 0
for i in range(0,len(a)):
  if (lcm // a[i]) % 2 == 1:
    sum += 1

if sum != len(a):
  ans = 0
print(ans)

Fixed submission:
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in range(0,len(a)):
  lcm = lcm * a[i] // gcd(lcm,a[i])

ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
sum = 0
for i in range(0,len(a)):
  if (lcm // a[i]) % 2 == 1:
    sum += 1

if sum != len(a):
  ans = 0
print(ans)

Fixed submission:
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import fractions as fra
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in range(0,len(a)):
  lcm = lcm * a[i] // fra.gcd(lcm,a[i])
 
ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
sum = 0
for i in range(0,len(a)):
  if (lcm // a[i]) % 2 == 1:
    sum += 1

if sum != len(a):
  ans = 0
print(ans)

Fixed submission:
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import fractions
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in range(0,n):
  lcm = lcm * a[i] // fractions.gcd(lcm,a[i])

ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
sum = 0
for i in range(0,n):
  if (lcm // a[i]) % 2 == 1:
    sum += 1   
if sum != n:
  ans = 0
print(ans)

Fixed submission:
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import fractions
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in range(0,n):
  lcm = lcm * a[i] // fractions.gcd(lcm,a[i])

ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
b = np.zeros(n)


for i in range(0,n):
  while a[i] % 2 == 0:
    b[i] += 1
    a[i] = a[i] // 2



for i in range(1,n):
  for j in range(0,i):
    if b[i] != b[j]:
      ans = 0
      break

print(ans)

Fixed submission:
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)

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

n,m = map(int, input().split())
a = list(map(int, input().split()))
st = np.lcm.reduce(a)
ans = m // st
if (ans+0.5) * st <= m:
  ans += 1
b = np.zeros(n)


for i in range(0,n):
  while a[i] % 2 == 0:
    b[i] += 1
    a[i] = a[i] // 2



for i in range(1,n):
  for j in range(0,i):
    if b[i] != b[j]:
      ans = 0
      break

print(ans)

Fixed submission:
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)