Harryxun/stf_run huggingface dataset:
from collections import defaultdict
N = int(input())
rates = [int(i) for i in input().split()]

color_nums = defaultdict(int)

for rate in rates:
    if rate <= 399:
        color_nums['灰'] += 1
    elif rate <= 799:
        color_nums['茶'] += 1
    elif rate <= 1199:
        color_nums['緑'] += 1
    elif rate <= 1599:
        color_nums['水'] += 1
    elif rate <= 1999:
        color_nums['青'] += 1
    elif rate <= 2399:
        color_nums['黄'] += 1
    elif rate <= 2799:
        color_nums['橙'] += 1
    elif rate <= 3199:
        color_nums['赤'] += 1
    else:
        color_nums['自由'] += 1

free_num = color_nums['自由']
if free_num == 0:
    # 自由に変えられる人がいない場合
    print(len(color_nums), len(color_nums))
elif free_num == N:
    # 自由に変えられる人しかいない場合
    print(min(N, 8), 1)
elif free_num != N:
    # 自由な人と混在
    tmp = dict(free_num)  # コピーを作る
    tmp.pop('自由')
    l_tmp = len(tmp)
    min_num = l_tmp
    max_num = l_tmp + free_num
    print(max_num, min_num)


### FIXED CODE ###

from collections import defaultdict
N = int(input())
rates = [int(i) for i in input().split()]
# N = 4
# rates = [2100, 2500, 2700, 2700]

color_nums = defaultdict(int)

for rate in rates:
    if rate <= 399:
        color_nums['灰'] += 1
    elif rate <= 799:
        color_nums['茶'] += 1
    elif rate <= 1199:
        color_nums['緑'] += 1
    elif rate <= 1599:
        color_nums['水'] += 1
    elif rate <= 1999:
        color_nums['青'] += 1
    elif rate <= 2399:
        color_nums['黄'] += 1
    elif rate <= 2799:
        color_nums['橙'] += 1
    elif rate <= 3199:
        color_nums['赤'] += 1
    else:
        color_nums['自由'] += 1

free_num = color_nums['自由']
if free_num == 0:
    # 自由に変えられる人がいない場合
    # -1 は free_num = color_nums['自由']で増えてしまったので...
    print(len(color_nums)-1, len(color_nums)-1)
elif free_num == N:
    # 自由に変えられる人しかいない場合
    print(1, free_num)
elif free_num != N:
    # 自由な人と混在
    tmp = dict(color_nums)  # コピーを作る
    tmp.pop('自由')
    l_tmp = len(tmp)
    min_num = l_tmp
    max_num = l_tmp + free_num
    print(min_num, max_num)
a,b,c=map(int ,input().split())
K=int(input())

max=a
if b>max:
    max=b
if c>max:
    max=c
sum=a+b+c-max
for i in range(K):
    max*=2
print(sum+max)


### FIXED CODE ###

a,b=map(int ,input().split())

if a<=b:
    print(a)
else:
    print(a-1)
n=int(input())
l=list(map(int,input().split()))
x=0
y=0
c=0
for i in range(n):
    if(l[i]%4==0):
        x+=1
    elif(l[i]%2==0):
        y+=1
    else:
        c+=1
if(n%2==0):
    if(x>=c):
        print("Yes")
    else:
        print('No')
else:
    if(x>=(c-1)):
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

x,y=map(int,input().split())
print((x-1)*(y-1))
muri

### FIXED CODE ###

from collections import deque
k = int(input())
ans = 0
num = ["0","1","2","3","4","5","6","7","8","9"]
dq = deque(["1","2","3","4","5","6","7","8","9"])
# print(num[k:k+2])
if k<=12:
    print(k)
else:
    while 1:
        ans += 1
        a = dq.popleft()
        if ans == k:
            print(int(a))
            exit()
        for i in num[max(0,int(a[-1])-1):min(10,int(a[-1])+2)]:
            dq.append(a+i)
a,b,t=map(int,input().split())
i=1
while i*a<t+0.5:
  i++
print((i-1)*b)

### FIXED CODE ###

a,b,t=map(int,input().split())
i=1
while i*a<t+0.5:
  i+=1
print((i-1)*b)
N = str(input())
print((N-1)//2)

### FIXED CODE ###

N = int(input())
print((N-1)//2)
X, N = map(int, input().split())
p = list(map(int, input().split()))

if N == 0:
    print(X)
    break
    
else:
    for i in range(100):
    if (X-(i+1)) and (X+i+1) in p:
        continue
    
    elif (X-i-1) not in p:
        print(X-i-1)
        break
    
    elif (X+i+1) not in p:
        print(X+i+1)
        break


### FIXED CODE ###

X, N = map(int, input().split())
p = list(map(int, input().split()))

if N == 0:
    print(X)

elif X not in p:
    print(X)
    
else:
    for i in range(110):
        if (X-(i+1)) in p and (X+i+1) in p:
            continue
    
        else:
            if(X-(i+1)) not in p:
                print(X-(i+1))
                break
    
            elif (X+i+1) not in p:
                print(X+i+1)
                break
def splitter(type,input):
    return list(map(lambda x:type(x),input.split()))

s1 = splitter(int,input())
N = s1[0]
K = s1[1]
Q = s1[2]

ar = [0] * N
for i in len(range(Q)):
    ar[int(input())] += 1
for j in len(range(N)):
    if K-Q+ar[j] <= 0:
        print("No")
    else:
        print("Yes")



### FIXED CODE ###

def splitter(type,input):
    return list(map(lambda x:type(x),input.split()))

s1 = splitter(int,input())
N = s1[0]
K = s1[1]
Q = s1[2]

ar = [0] * N
for i in range(Q):
    ar[int(input())-1] += 1
for j in range(N):
    if K-Q+ar[j] <= 0:
        print("No")
    else:
        print("Yes")
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")


### FIXED CODE ###

n,k=map(int,input().split())
s=list(input())
t=s.pop(k-1)
s.insert(k-1,t.lower())
print("".join(s))
import bisect
import sys

def input():
  return sys.stdin.readline()

weather = {0:"Sunny", 1:"Cloudy", 2:"Rainy"}
n = input()
           
for k, v in weather.items():
  if v == n:
    nk = k
    break

nk = (nk+1) % 3

print(weather[nk])


### FIXED CODE ###

n = input()
weather = {0:"Sunny", 1:"Cloudy", 2:"Rainy"}

           
for k, v in weather.items():
  if v == n:
    nk = k
    break

nk = (nk+1) % 3

print(weather[nk])
a, b = map(int, input().split())
if (a+b)%2 == 1:
    print (IMPOSSIBLE )
else:
    print ((a+b)/2)

### FIXED CODE ###

a, b = map(int, input().split())
if ((a+b)%2) == 1:
    print ('IMPOSSIBLE')
else:
    print ((a+b)//2)
import math
N = input()
answers = []
for val in range(1,N+1):
	x = map(float,raw_input().split(' '))
	d = math.sqrt((x[0]-x[3])**2 - (x[1]-x[4])**2)
	s = x[2]+x[5]
	r = math.fabs(x[2]-x[5])
	if r >= d:
		if x[2] > x[5]:
			answers.append(2)
		else:
			answers.append(-2)
	elif s < d:
		answers.append(0)
	else:
		answers.append(1)
for val in answers:
	print val

### FIXED CODE ###

import math
N = input()
answers = []
for val in range(1,N+1):
	x = map(float,raw_input().split(' '))
	d = (x[0]-x[3])**2 + (x[1]-x[4])**2
	d = math.sqrt(d)
	d = math.fabs(d)
	s = x[2]+x[5]
	r = math.fabs(x[2]-x[5])
	if d > s:
		answers.append(0)
	elif d == s:
		answers.append(1)
	elif d < s:
		if d < r:
			if x[2] > x[5]:
				answers.append(2)
			else:
				answers.append(-2)
		elif d >= r:
			answers.append(1)
for val in answers:
	print val
from collections import deque
n, m = map(int, input().split())
INF = 100000000

to = []
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
print('Yes')
q = deque([])
dist = [INF] * n
pre = [-1] * n
dist[0] = 0
q.append(0)

while len(q) > 0:
    v = q.popleft()
    for i in to[v]:
        if dist[i] != INF:
            continue
        dist[i] = dist[v+1]
        pre[i] = v
        q.append(i)

for i in range(n):
    ans = pre[i]
    ans += 1
    print(ans)


### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
INF = 100000000

to = [[] for _ in range(100005)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
print('Yes')
q = deque([])
dist = [INF] * n
pre = [-1] * n
dist[0] = 0
q.append(0)

while len(q) > 0:
    v = q.popleft()
    for i in to[v]:
        if dist[i] != INF:
            continue
        dist[i] = dist[v] + 1
        pre[i] = v
        q.append(i)

for i in range(1, n):
    ans = pre[i]
    ans += 1
    print(ans)
from collections import deque


class Bt(object):
    def __init__(self):
        self.used = [False] * 10  # ?????°???????????¨?????????????????????????????°
        self.answers = []  # ?????¶???????????????????????????
        self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨

    def solve(self, num, rem):
        num -= 1
        if rem < 10 and self.used[rem] == False and num == 0:
            self.Q.append(rem)
            # print('{0}'.format(self.Q))
            ans = [*self.Q]
            ans.sort()
            if not ans in self.answers:
                self.answers.append(ans)
            self.Q.pop()
            return

        try:
            min_num = self.used.index(True)
        except ValueError:
            min_num = 0

        for i in range(min_num, 10):
            if self.used[i] == False and (rem - i) >= 0:
                self.used[i] = True
                self.Q.append(i)
                self.solve(num, rem - i)
                self.used[i] = False
                self.Q.pop()


if __name__ == '__main__':
    while True:
        # ??????????????\???
        n, s = [int(x) for x in input().split(' ')]
        if n == 0 and s == 0:
            break

        # ????????????
        a = Bt()
        a.solve(n, s)

        # ???????????¨???
        print(len(a.answers))

### FIXED CODE ###

from collections import deque


class Bt(object):
    def __init__(self):
        self.used = [False] * 10  # 0-9????????°???????????¨?????????????????????????????°
        self.answers = []  # ?????¶???????????????????????????
        self.Q = deque()  # ????????§???????????¢??????????????°???????¨???¶??¨

    def solve(self, num, remain):
        # ????´¢??????????°??????§?????????????????????????????§????????????????????§????????°??????????????????????????????
        try:
            min_choice = max(self.Q) + 1
        except ValueError:
            min_choice = 0

        if min_choice <= remain < 10 and self.used[remain] == False and num == 1:
            self.Q.append(remain)
            # print('{0}'.format(self.Q))
            #ans = [*self.Q]
            ans = []
            for i in self.Q:
                ans.append(i)
            ans.sort()
            if not ans in self.answers:
                self.answers.append(ans)
            self.Q.pop()
            # self.answers.append(1)
            return
        elif num < 0:
            return

        for i in range(min_choice, 10):
            if self.used[i] == False and (remain - i) >= 0:
                self.used[i] = True
                self.Q.append(i)
                self.solve(num - 1, remain - i)
                self.used[i] = False
                self.Q.pop()


if __name__ == '__main__':
    while True:
        # ??????????????\???
        n, s = [int(x) for x in input().split(' ')]
        if n == 0 and s == 0:
            break

        if 0 <= s <= 45:
            # ????????????
            a = Bt()
            a.solve(n, s)

            # ???????????¨???
            print(len(a.answers))
        else:
            print(0)
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('NO")
else:
        print('Yes')

### FIXED CODE ###

S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('No')
else:
  print('Yes')
N=int(input())
a=[int(input()) for i in range(N)]
b=[]
j=1
def c(j):
    if j==1:
        return 1
    else:
        return a[c(j-1)-1]
if 2 not in a:
    print(-1)
else:
    while a[c(j)-1] not in b:
        b.append(a[c(j)-1])
        if a[c(j)-1]==2:
            break
        else:
            j += 1
    if 2 not in b:
        print(-1)
    else:
        print(len(b))

### FIXED CODE ###

N=int(input())
a=[int(input()) for i in range(N)]
b=[]
j=1
k=1
c=1
if 2 not in a:
    print(-1)
else:
    while j in range(1,N+1):
         c += 1
         if a[k-1]==1:
                 print(-1)
                 break
         elif a[k-1]==2:
                 print(c-1)
                 break
         else:
            j += 1
            k = a[k-1]
    if c>=(N+1):
        print(-1)
import sys
input = sys.stdin.readline

S = input()
N = len(S)
mod_13 = [10 ** i % 13 for i in range(N)]
table = [[0] * 13 for _ in range(N + 1)]
table[0][0] = 1

for i, char in enumerate(reversed(S)):
    c = char != '?'
    for j in range(13):
        for k in range(10):
            if c and int(char) != k:
                continue
            table[i+1][(j + mod_13[i] * k)  % 13] += table[i][j]
            table[i+1][(j + mod_13[i] * k)  % 13] %= (10 ** 9 + 7)

print(table[N][5])


### FIXED CODE ###

S = input()
mod = 10 ** 9 + 7
N = len(S)
table = [[0] * 13 for _ in range(N + 1)]
table[0][0] = 1

dd = 1

for i, char in enumerate(reversed(S)):
    c = char != '?'
    for j in range(13):
        for k in range(10):
            if c and int(char) != k:
                continue
            table[i+1][(j + dd * k)  % 13] += table[i][j]
            table[i+1][(j + dd * k)  % 13] %= mod
    dd = (dd * 10) % 13

print(table[N][5])
n=int(input())
sp=[]
for i in range(n):
    s,p=input().split()
    sp.append(s,-int(p),i+1)
sp.sort()
for i in sp:
    print(i[2])


### FIXED CODE ###

n=int(input())
sp=[list(map(str,input().split()))+[i+1] for i in range(n)]
for i in range(n):
    sp[i][1]=int(sp[i][1])

sp.sort(key=lambda x:x[1],reverse=True)

sp.sort(key=lambda x:x[0])
for i in range(n):
    print(sp[i][2])
import numpy as np

n = int(input())
edges = [list(map(int, input().split())) for _ in range(n - 1)]

grid = np.zeros([n, n])

for i in range(n - 1):
  edge = sorted(edges[i])
  grid[edge[0] - 1][edge[1] - 1] = 1

components = 0
for i in range(n):
  for j in range(i, n):
    loss = grid[i:j + 1, i:j + 1].sum()
    components += j - i + 1 - loss
  
print(int(components))

### FIXED CODE ###

a = int(input())

if a % 1000 == 0:
  out = 0
else:
  out = 1000 - a % 1000

print(out)
h,a=map(int,inout().split())
print((h-1)//a+1)

### FIXED CODE ###

h, a = map(int, input().split())
print((h - 1) // a + 1)
#coding: utf-8

N = input()
N_list = list(N)

if N_list[0] == N_list[1] == N_list[2] or N_list[1] == N_list[2] == N_list[3] or  N_list[2] == N_list[3] == N_list[4]:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

#coding: utf-8

N_list = list(input())

if N_list[0] == N_list[1] == N_list[2]:
	print("Yes")
elif N_list[1] == N_list[2] == N_list[3]:
	print("Yes")
else:
	print("No")
# 正の整数aとb

# aとbの積が偶数か奇数か判別する
a = int( input() )
b = int( input() )

# 積が奇数なら'Odd'、偶数なら'Even'と出力する
if int(a * b / 2) == int(a * b / 2 + 0.5):
    print('even')
else:
    print('Odd')

### FIXED CODE ###

# 正の整数aとb
a, b = map(int, input().split())
# aとbの積が偶数か奇数か判別する

# 積が奇数なら'Odd'、偶数なら'Even'と出力する
if int(a * b / 2) < int(a * b / 2 + 0.5):
    print('Odd')
else:
    print('Even')
if input() = "abc" or "acb" or "cba" or "bac" or "bca" or "cab":
  print(Yes)
else:
  print(No)

### FIXED CODE ###

print("Yes" if len(set(input())) == 3 else "No")
n, m  = map(int,input().split())
a = [int(input()) for _ in range(m)]

MOD = 10**9+7

dp = [0]*(n+1)
ng = [False]*(n+1)
for i in a:
    ng[a] = True
    
dp[0] = 1
if not ng[1]:
    dp[1] = 1
for i in range(2, n+1):
    if a[i]:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[n])

### FIXED CODE ###

n, m  = map(int,input().split())
a = [int(input()) for _ in range(m)]

MOD = 10**9+7

dp = [0]*(n+1)
ng = [False]*(n+1)
for i in a:
    ng[i] = True
    
dp[0] = 1
if not ng[1]:
    dp[1] = 1
for i in range(2, n+1):
    if ng[i]:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[n])
N = int(input())
HPs = list(map(int, input().split()))

while len(HPs) > 1:
    HPs.sort()
    for i in range(len(HPs)-1):
        HPs[i+1] = HPs[i+1] % HPs[0]
    while 0 in HPs:
        HPs.remove(0)

print(HPs[0])

### FIXED CODE ###

A, B = map(int,input().split())

Q = B/A

if Q.is_integer():
    print(A+B)
else:
    print(B-A)
import sys
import numpy as np

input=sys.stdin.readline

N, M = [int(x) for x in input().split()]
A = []
for _ in range(N):
    A.append([int(x) for x in input().split()])

total = 0

for x in range(1, M + 1):
    max = 0
    max_index = -1
    for y, row in enumerate(A):
        if row[0] <= x and row[1] > max:
            max = row[1]
            max_index = y
    if max_index != -1:
        total += max
        A.pop(max_index)

print(total)





### FIXED CODE ###

from collections import defaultdict
import heapq

N, M = [int(x) for x in input().split()]

dict = defaultdict(list)
for _ in range(N):
    A, B = [int(x) for x in input().split()]
    dict[A].append(B)

h = []
total = 0
for x in range(1, M + 1):
    for y in dict[x]:
        heapq.heappush(h, -y)
    if h:
        total += heapq.heappop(h)

print(-total)
N=int(input())
List=[int(input()) for i in range(N)]
List.sort(key=lambda x:x)
n=1
So=[]
while n<=List[N-1]:
  if n in List:
    So.append(n)
  n+=1
print(len(So))

### FIXED CODE ###

S=input()
print("2018/"+S[5:])
N, K = map(int, input().split())
fruits = map(int, input().split())

return sorted(fruit)[:K]

### FIXED CODE ###

N, K = map(int, input().split())
fruits = map(int, input().split())

print(sum(sorted(fruits)[:K]))
import statistics as st
word1 = []
word = raw_input().split()
for i in xrange(len(word)):
	word1.append(len(word[i]))
for i in xrange(len(word)):
	if len(word[i]) == max(word1):
		print st.mode(word), word[i]
		break

### FIXED CODE ###

s = raw_input().split()
maxLength, maxCount = 0, 0
word1, word2, count = "", "", {}
for i in range(len(s)):
	count[s[i]] = 0
for i in range(len(s)):
	count[s[i]] += 1
	if(len(s[i]) > maxLength):
		maxLength = len(s[i])
		word2 = s[i]
for i in range(len(s)):
	if(count[s[i]] > maxCount):
		maxCount = count[s[i]]
		word1 = s[i]
print word1, word2
N = int(input())
x = [0]*N
y = [0]*N
h = [0]*N

for i in range(N):
	x[i], y[i], h[i] = map(int, input().split())
for cx in range(101):
	for cy in range(101):
		H = abs(x[0]-cx)+abs(y[0]-cy)+h[0]
		for i in range(N):
			if H != abs(x[i]-cx)+abs(y[i]-cy)+h[i]:
				break
			if i == N-1:
				ans = [cx, cy, H]
				break
print(ans[0],ans[1],ans[2])


### FIXED CODE ###

N = int(input())
p = [0, 0, 0]*N

p = [list(map(int, input().split())) for _ in range(N)]
p = sorted(p, key=lambda x:-x[2])
for cx in range(101):
	for cy in range(101):
		H = abs(p[0][0]-cx)+abs(p[0][1]-cy)+p[0][2]
		for i in range(N):
			# if H != abs(x[i]-cx)+abs(y[i]-cy)+h[i]:
			if p[i][2] != max(H-abs(p[i][0]-cx)-abs(p[i][1]-cy), 0):
				break
			if i == N-1:
				ans = [cx, cy, H]
				break
print(ans[0],ans[1],ans[2])
from math import gcd
A,B = map(int, input().split())
print(A * B // gcd(A,B))

### FIXED CODE ###

def gcd(x,y):
    if x==0:
        return y
    elif y==0:
        return x
    
    if x<y:
        x,y = y,x
    return gcd(y, x%y)

A,B = map(int, input().split())
print( (A * B) // gcd(A,B))
N,L = map(str,input().split())

words = list()
for i in range(N):
  words.append(input())
  
words = words.sort()

print(*words,seq ="")

### FIXED CODE ###

N,L = map(int,input().split())

words = list()
for i in range(N):
  words.append(input())
  
words.sort()

print(*words,sep ="")
def zen(s):
    ans=0
    for i in range(len(s)-1):
        if s[i]==s[i+1]:
            ans+=1
        if len(s)-1==ans:
            return True
        else:
            return False

s=input()
k=int(input())
l=0
cnt=[]
ans=0
p=1
c=1
if zen(s):
    print(len(s)*k//2)
else:
    for i in range(len(s)-1):
        if s[i]==s[i+1]:
            c+=1
            if i==len(s)-2:
                cnt.append(c)
        else:
            cnt.append(c)
            c=1
    ans=0
    if s[0]==s[-1] and cnt[-1]%2==1 and cnt[0]%2==1:
        for i in range(len(cnt)):
            ans+=cnt[i]//2
        print(ans*k+(k-1))
    else:
        for i in range(len(cnt)):
            ans+=cnt[i]//2
        print(ans*k)

### FIXED CODE ###

def is_all(t):
    for i in range(len(t)-1):
        if t[i]!=t[i+1]:
            return False
    return True

s=input()
n=len(s)
k=int(input())
cor=[1]
ans=0
c=1
if is_all(s):
    print(n*k//2)
    exit()
i=0
while i<n-1:
    if s[i]==s[i+1]:
        cor[0]+=1
        i+=1
    else:
        i+=1
        break
while i<n-1:
    if s[i]==s[i+1]:
        cor.append(1)
        while i<n-1:
            if s[i]==s[i+1]:
                cor[-1]+=1
                i+=1
            else:
                break
    i+=1
#print(cor)
if s[0]==s[-1]:
    for i in range(1,len(cor)-1):
        ans+=cor[i]//2
    ans*=k
    ans+=(cor[0]+cor[-1])//2*(k-1)
    print(ans+cor[0]//2+cor[-1]//2)
else:
    for i in range(len(cor)):
        ans+=cor[i]//2
    print(ans*k)
n=int(input())
a=[map(int,input().split())]
a=map(lambda x:x//400,a)
a1=[i for i in a if i<8]
a2=[i for i in a if i>7]
k=len(set(a1))
if k+len(a2)>8:m=8
else:m=k+len(a2)

print(len(set(a1)),m)

### FIXED CODE ###

import numpy as np
n=int(input())
a=list(map(int,input().split()))
a=np.array(a)
a=a//400
a1=[i for i in a if i<8]
a2=[i for i in a if i>=8]
k=len(set(a1))
m=k+len(a2)
#>8:m=8 else:m=k+len(a2)
if len(set(a1))!=0:s=len(set(a1))
else:s=1
print(s,m)
from fractions import gcd
#from math import gcd
from functools import reduce

def lcm(a,b):
    return int(a * b / gcd(a, b))

N, M = map(int,input().split())
A = set(list(map(int,input().split())))

for i, a in enumerate(A):
    if i == 0:
        lcmA = a
    else:
        lcmA = int(a * lcmA / gcd(a, lcmA))

lcmA = reduce(lcm, A)
if M < lcmA//2:
    print(0)
else:
    print( 1 + (M - max(lcmA//2, min(A) * 0.5))//lcmA)

### FIXED CODE ###

import fractions
import functools

def lcm(n1, n2):
    return n1 * n2 // fractions.gcd(n1, n2)

N, M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N):
    A[i] //= 2

lcmA = functools.reduce(lcm, A)
gcdA = functools.reduce(fractions.gcd, A)
if (lcmA // gcdA) % 2 == 0:
    print(0)
else:
    print((M // lcmA + 1) // 2)
# -*- coding: utf-8 -*-

import sys
import os
import pprint
from queue import Queue

"""Topological Sort"""

#fd = os.open('GRL_4_B.txt', os.O_RDONLY)
#os.dup2(fd, sys.stdin.fileno())

V, E = list(map(int, input().split()))
G = [[] for i in range(V)]
indig = [0] * V # ??\?¬???°
for i in range(V):
    s, t = list(map(int, input().split()))
    G[s].append(t)
    indig[t] += 1

q = Queue()
out = []

def bfs(node_index):
    q.put(node_index)

    while not q.empty():
        u = q.get()
        out.append(u)

        # u?????????????????§u?????????indig????????????
        for index in G[u]:
            indig[index] -= 1
            if indig[index] == 0:
                q.put(index)

# bfs?????????
indig_copy = indig[:]
for i in range(V):
    if indig_copy[i] == 0:
        bfs(node_index=i)

for v in out:
    print(v)

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
import os
import pprint
from queue import Queue

"""Topological Sort"""

#fd = os.open('GRL_4_B_5.txt', os.O_RDONLY)
#os.dup2(fd, sys.stdin.fileno())

V, E = list(map(int, input().split()))
G = [[] for i in range(V)]
indig = [0] * V # ??\?¬???°
for i in range(E):
    s, t = list(map(int, input().split()))
    G[s].append(t)
    indig[t] += 1

q = Queue()
out = []

def bfs(node_index):
    q.put(node_index)

    while not q.empty():
        u = q.get()
        out.append(u)

        # u?????????????????§u?????????indig????????????
        for index in G[u]:
            indig[index] -= 1
            if indig[index] == 0:
                q.put(index)

# bfs?????????
indig_copy = indig[:]
for i in range(V):
    if indig_copy[i] == 0:
        bfs(node_index=i)

for v in out:
    print(v)