Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x/2),map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i/gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M/(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()


Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)/2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i/gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()


Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)/2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i/gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()


Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)/2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM/i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()


Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)/2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i/gcd(LCM,i)

    for i in List:
        if LCM/i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)/2,input().split()))

def main():
    LCM=1
    
    for i in List:
        LCM*=i/gcd(LCM,i)

    for i in List:
        if LCM/i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

from fractions import gcd

N,M=map(int,input().split())
#List=list(map(lambda x:int(x)/2,input().split()))
List=list(map(int,input().split()))

def main():
    LCM=1
    cut2count=0
    a=List[0]/2
    while a%2==0:
        a/=2
        cut2count+=1

    for i in List:
        i/=2
        LCM*=i/gcd(LCM,i)
            
        cut2countb=0
        b=i
        while b%2==0:
            b/=2
            cut2countb+=1
        if cut2count!=cut2countb:
            print(0)
            exit()


    #for i in List:
    #   if LCM/i%2==0:
    #      print(0)
    #     exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

N,M=map(int,input().split())
#List=list(map(lambda x:int(x)/2,input().split()))
List=list(map(int,input().split()))

def main():
    LCM=1
    cut2count=0
    a=List[0]/2
    while a%2==0:
        a/=2
        cut2count+=1

    for i in List:
        i/=2
        LCM*=i/gcd(LCM,i)
            
        cut2countb=0
        b=i
        while b%2==0:
            b/=2
            cut2countb+=1
        if cut2count!=cut2countb:
            print(0)
            exit()


    #for i in List:
    #   if LCM/i%2==0:
    #      print(0)
    #     exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

N,M=map(int,input().split())
#List=list(map(lambda x:int(x)/2,input().split()))
List=list(map(int,input().split()))

def main():
    LCM=1
    cut2count=0
    a=List[0]/2
    while a%2==0:
        a/=2
        cut2count+=1

    for i in List:
        i/=2
        LCM*=i/gcd(LCM,i)
            
        cut2countb=0
        b=i
        while b%2==0:
            b/=2
            cut2countb+=1
        if cut2count!=cut2countb:
            print(0)
            exit()


    #for i in List:
    #   if LCM/i%2==0:
    #      print(0)
    #     exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

N,M=map(int,input().split())
#List=list(map(lambda x:int(x)/2,input().split()))
List=list(map(int,input().split()))


LCM=1
cut2count=0
a=List[0]/2
while a%2==0:
    a/=2
    cut2count+=1

for i in List:
    i/=2
    LCM*=i/gcd(LCM,i)
        
    cut2countb=0
    b=i
    while b%2==0:
        b/=2
        cut2countb+=1
    if cut2count!=cut2countb:
        print(0)
        exit()


#for i in List:
 #   if LCM/i%2==0:
  #      print(0)
   #     exit()

print(int(M//(LCM*2)+M%(LCM*2)//LCM))


Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
from fractions import gcd

N,M=map(int,input().split())
#List=list(map(lambda x:int(x)/2,input().split()))
List=list(int,input().split()))


LCM=1
cut2count=0
a=List[0]
while a%2==0:
    a/=2
    cut2count+=1

for i in List:
    i/=2
    LCM*=i/gcd(LCM,i)
        
    cut2countb=0
    b=i
    while b%2==0:
        b/=2
        cut2count+=1
    if cut2count!=cut2countb:
        print(0)
        exit()


#for i in List:
 #   if LCM/i%2==0:
  #      print(0)
   #     exit()

print(int(M//(LCM*2)+M%(LCM*2)//LCM))


Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

N,M=map(int,input().split())
List=list(map(lambda x:int(x)/2,input().split()))

LCM=1
cut2count=0
a=List[0]
while a%2==0:
    a/=2
    cut2count+=1

for i in List:
    LCM*=i/gcd(LCM,i)
        
    cut2countb=0
    b=i
    while b%2==0:
        b/=2
        cut2countb+=1
    if cut2count!=cut2countb:
        print(0)
        exit()


#for i in List:
 #   if LCM/i%2==0:
  #      print(0)
   #     exit()

print(int(M//(LCM*2)+M%(LCM*2)//LCM))




Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

N,M=map(int,input().split())
List=list(map(lambda x:int(x)/2,input().split()))

LCM=1
for i in List:
    LCM*=i/gcd(LCM,i)

for i in List:
    if LCM/i%2==0:
        print("0")
        exit()

print(int(M//(LCM*2)+M%(LCM*2)//LCM))

Fixed submission:
from fractions import gcd
import sys
input = sys.stdin.readline

N,M=map(int,input().split())
List=list(map(lambda x:int(x)//2,map(int, set(input().split()))))

def main():
    LCM=1

    for i in List:
        LCM*=i//gcd(LCM,i)

    for i in List:
        if LCM//i%2==0:
            print(0)
            exit()

    print(int(M//(LCM*2)+M%(LCM*2)//LCM))


if __name__ == '__main__':
    main()