Problem: Given are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.  Let a _semi-common multiple_ of A be a positive integer X that satisfies the following condition for every k (1 \leq k \leq N):    * There exists a non-negative integer p such that X= a_k \times (p+0.5).  Find the number of semi-common multiples of A among the integers between 1 and M (inclusive).

Submission attempts (in order):
import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
x = m // (int(lcm)/2)
y = m // lcm
print(int(x-y))

import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
sum = 0
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
    sum += int(l[i]) % 2

if sum == len(l) or sum == 0:
    x = m // (int(lcm) / 2)
    y = m // lcm
    print(int(x - y))
else:
    print(0)

import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
sum = 0
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
for i in range(len(l)):
    if lcm // int(len(i)) % 2 == 1:
        sum += 1
if sum == len(l):
    x = m // (int(lcm) / 2)
    y = m // lcm
    print(int(x - y))
else:
    print(0)

import fractions
n,m = map(int,input().split())
l = input().split()
for i in range(len(l) -1):
    lcm = (int(l[i]) * int(l[i + 1])) // fractions.gcd(int(l[i]), int(l[i + 1]))
x = m // (int(lcm)/2)
y = m // lcm
print(int(x-y))

import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
sum = 0
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
for i in range(len(l)):
    if (lcm // int(l[i])) % 2 == 1:
        sum += 1
if sum == len(l):
    x = m // (int(lcm) / 2)
    y = m // lcm
    print(int(x - y))
else:
    print(0)

import fractions
n,m = map(int,input().split())
a,b = map(int,input().split())
lcm = (a * b) // fractions.gcd(a, b)
x = m // (lcm /2 )
y = m // (lcm)
print(int(x-y))

import fractions
n,m = map(int,input().split())
l = input().split()
for i in range(len(l) -1):
    lcm = (int(l[i]) * int(l[i + 1])) // fractions.gcd(int(l[i]), int(l[i + 1]))
x = m // (int(lcm)/2)
y = m // lcm
print(int(x-y))

import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
sum = 0
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
    sum += int(l[i]) % 2
    
if sum == len(l) or sum == 0:
    print(0)
else:
    x = m // (int(lcm)/2)
    y = m // lcm
    print(int(x-y))

import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
    
counter = 0
sum = 0

for i in range(len(l)):
    if lcm // int(l[i]) % 2 == 1:
        counter += 1
        
if counter == len(l):
    sum += 1

x = m // (int(lcm)/2)
y = m // lcm
print(int(x-y))

ort fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
sum = 0
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
for i in range(len(l)):
    if (lcm // int(l[i])) % 2 == 1:
        sum += 1
if sum == len(l):
    x = m // (int(lcm) / 2)
    y = m // lcm
    print(int(x - y))
else:
    print(0)

import fractions
n,m = map(int,input().split())
l = input().split()
for i in range(len(l)):
    lcm = (int(l[i]) * int(l[i + 1])) // fractions.gcd(int(l[i]), int(l[i + 1]))
x = m // (int(lcm)/2)
y = m // lcm
print(int(x-y))

import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
for i in range(len(l) -1):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
x = m // (int(lcm)/2)
y = m // lcm
print(int(x-y))

import fractions
n,m = map(int,input().split())
a,b = map(int,input().split())
lcm = (a * b) // fractions.gcd(a, b)
x = m // (int(lcm)/2)
y = m // lcm
print(int(x-y))

import fractions
n,m = map(int,input().split())
l = input().split()
lcm = 1
sum = 0
for i in range(len(l)):
    lcm = (int(l[i]) * lcm) // fractions.gcd(int(l[i]), lcm)
for i in range(len(l)):
    if (lcm // int(l[i])) % 2 == 1:
        sum += 1
if sum == len(l):
    x = m // (int(lcm) / 2)
    y = m // lcm
    print(int(x - y))
else:
    print(0)

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
 
def div_ceil(x, y): return (x + y - 1) // y
 
N, M = map(int, input().split())
*A, = map(int, input().split())
A = list(set([a // 2 for a in A]))
L = A[0]
for a in A[1:]:
    L *= a // gcd(L, a)
for a in A:
    if (L // a) % 2 == 0:
        ans = 0
        break
else:
    ans = div_ceil(M // L, 2)
print(ans)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted