Harryxun/stf_run huggingface dataset:
# coding: utf-8
# Your code here!
from operator import mul
from functools import reduce

def comb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**6 + 1
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
    
    
    
r1, c1, r2, c2 = [int(i) for i in input().split()]
 
def calc(r, c):
    a = comb(r + c + 2, r + 1, mod) - r - c - 2
    b = r * (r + 3) / 2
 
    if c == 1:
        return b
    else:
        return a
 
result = calc(r2, c2) - calc(r2, c1 - 1) - calc(r1 - 1, c2) + calc(r1 - 1, c1 - 1)
 
print(result)



### FIXED CODE ###

from operator import mul
from functools import reduce

def comb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 3 * 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
    
    
    
r1, c1, r2, c2 = [int(i) for i in input().split()]
 
def calc(r, c):
    a = comb(r + c + 2, r + 1, mod) - r - c - 2
    b = r * (r + 3) / 2
 
    if c == 1:
        return b
    else:
        return a
 
result = calc(r2, c2) - calc(r2, c1 - 1) - calc(r1 - 1, c2) + calc(r1 - 1, c1 - 1)
result %= mod
if result < 0:
  result += mod
print(result)
import sys

input = lambda : sys.stdin.readline

# 入力
N = int(input())

S1 = [] # 増えるシーケンス用
S2 = [] # 減るシーケンス用

# 入力その２
for i in range(N):

    S = input()  # シーケンス
    mid, end = 0, 0    

    for s in S:
        if s == '(':
            end += 1
        else:
            end -= 1
            
        mid = min(mid, end)  # 途中経過で一番減るところを探す

    if end > 0:
        S1.append((mid, end))
    else:
        S2.append((mid-end, -end))

S1.sort(reverse=True)
# S2.sort(key = lambda x : (x[0], -x[1]))
S2.sort(reverse=True)


mid = end1 = 0  # スタート
out = False

for t in S1:
    a, b = t
    mid = end1 + a
    end1 = end1 + b
    if mid < 0 or end1 < 0:  # 途中で左カッコの数が右を上回る
        out = True
        break

mid = end2 = 0  # スタート
for t in S2:
    a, b = t
    mid = end2 + a
    end2 = end2 + b
    if mid < 0 or end2 < 0:  # 途中で左カッコの数が右を上回る
        out = True
        break
        
if (not end1 == end2) or out:  # 右、左 の数が合わない
    print('No')
else:
    print('Yes')

### FIXED CODE ###

# 入力
N = int(input())

S1 = [] # 増えるシーケンス用
S2 = [] # 減るシーケンス用

# 入力その２
for i in range(N):

    S = input()  # シーケンス
    mid, end = 0, 0    

    for s in S:
        if s == '(':
            end += 1
        else:
            end -= 1
            
        mid = min(mid, end)  # 途中経過で一番減るところを探す

    if end > 0:
        S1.append((mid, end))
    else:
        S2.append((mid-end, -end))

S1.sort(reverse=True)
# S2.sort(key = lambda x : (x[0], -x[1]))
S2.sort(reverse=True)


mid = end1 = 0  # スタート
out = False

for t in S1:
    a, b = t
    mid = end1 + a
    end1 = end1 + b
    if mid < 0 or end1 < 0:  # 途中で左カッコの数が右を上回る
        out = True
        break

mid = end2 = 0  # スタート
for t in S2:
    a, b = t
    mid = end2 + a
    end2 = end2 + b
    if mid < 0 or end2 < 0:  # 途中で左カッコの数が右を上回る
        out = True
        break
        
if (not end1 == end2) or out:  # 右、左 の数が合わない
    print('No')
else:
    print('Yes')
import math
print(math.sqrt( {0}*{0} + {1}*{1} - 2*{0}*{1}*math.cos(math.radians(abs(( {2} * 30 - 11/2 * {3})))).format(map(int, input().split()))

### FIXED CODE ###

import math
A,B,H,M = map(int,input().split())
rad = abs(( H + M/60 ) * 30 - 6 * M)
rad = math.radians(rad)
cos = math.cos(rad)
answer = math.sqrt( A*A + B*B - 2*A*B*cos)
print(answer)
def main():
	data = list(map(int,input().split()))
	a = data[0]
	b = data[1]
	c = data[2]
	d = data[3]
	min1 = min(a,b)
	min2 = min(c,d)
	print(min1+min2)

if __name__ == '__main__':
	main()

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())

print(min(a,b)+min(c,d))
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import copy

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''

n = int(stdin.readline().rstrip())
d = stdin.readline().rstrip().split()
res = 0
count1 = 0
for el1 in d:
    count2 = 0
    for el2 in d:
        if (count2 > count1):
            res += int(el1) * int(el2)
        count2 += 1
    count1 += 1

print(res)


### FIXED CODE ###

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import copy

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.extend(要素)
.insert(場所,要素)
-1で末尾で末尾から一つ前
'''
'''
間に空白追加
' '.join(lis)
'''
'''
copy.copy(配列名)
'''

tes = stdin.readline().rstrip().split()
a = int(tes[0])
b = int(tes[1])
res = a - b * 2
if (res <= 0):
    print(0)
else:
    print(res)
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5]

for i in range(5)
  for i in range(5)
    if max <= price[5] - price[i]:
      print max

### FIXED CODE ###

import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans
#input an interget
k=int(input())
#input an string
str1=str(input())
#get the length of the string
x=int(len(str1))
#get the difference in length between k and s
i=x-k
#initialise y
y=0
#make a second string for the appending
str2="..."

#if statement about how the string will function
#if the string is the same length as k then print it
if i==0:
    print(str1)
#if not, delete the last character of the string and then print it
else:
    while y<k:
        print(str1[y],end=(""))
        y+=1
    print(str2)


### FIXED CODE ###

# Take the input K
# Take the inpus S

#Compare the length of S with K and put in in length
#If length<=K... print all
#If length>K... print some of the character

K = int(input()) # 0(1)
S = input() #0(1)
second_answer = [] #0(1)
x = 0 #0(1)

length = len(S) #0(1)

if length <= K : 
    print(S) #0(1)
else:
    while x<K : #0(K)
        print(S[x], end= (""))
        x += 1
    print("...")
W,H,x,y=map(int,input().split());print(str(W*H/2)+' 1' if W%x==0 and H%y==0 else str(W*H/2)+' 0')

### FIXED CODE ###

W,H,x,y=map(int,input().split());print(W*H/2,1*(W/2==x and H/2==y))
import sys
import numpy as np
from numba import njit
input = sys.stdin.buffer.readline

N = int(input())
vws = [tuple(map(int, input().split())) for _ in range(N)]

n = min(2**10, N)

dp = np.zeros((n, 10**5+1), np.int32)
dp[0, vws[0][1]:] = vws[0][0]
for i in range(1, n):
    v, w = vws[i]
    dp[i] = dp[(i-1)//2]
    dp[i, w:] = np.maximum(dp[(i-1)//2, :-w]+v, dp[i, w:])

@njit(cache = True)
def func():
    bits = np.arange(1 << len(vws_choose))
    values = np.zeros_like(bits, np.int32)
    weights = np.zeros_like(bits, np.int32)
    for i in range(len(vws_choose)):
        indices = np.nonzero(np.bitwise_and(bits, 1<<i))
        values[indices] += vws_choose[i][0]
        weights[indices] += vws_choose[i][1]

    mask = (weights <= L)     
    print(np.amax(dp[V][L - weights[mask]] + values[mask]))


Q = int(input())
for _ in range(Q):
    V, L = map(int, input().split())
    V -= 1
    if V < n:
        print(dp[V][L])
    else:
        vws_choose = []
        while V >= n:
            vws_choose.append(vws[V])
            V = (V-1) // 2
        func()


### FIXED CODE ###

import sys
import numpy as np
from numba import njit

input = sys.stdin.buffer.readline

N = int(input())
vws = [tuple(map(int, input().split())) for _ in range(N)]

n = min(2**11, N)
vws_arr = np.array(vws, np.int32)

dp = np.zeros((n, 10**5+1), np.int32)
for i in range(n):
    v, w = vws[i]
    dp[i] = dp[(i-1)//2]
    dp[i, w:] = np.maximum(dp[(i-1)//2, :-w]+v, dp[i, w:])


@njit("i4(i4[::1], i4[::1], i4, i4[::1])", cache = True)
def func(vs, ws, L, dp_):
    values = np.zeros(1 << len(vs), np.int32)
    weights = np.zeros(1 << len(vs), np.int32)
    for i in range(len(vs)):
        for bits in range(1 << len(vs)):
            if bits & (1 << i):
                values[bits] += vs[i]
                weights[bits] += ws[i]
    ret = 0
    for v, w in zip(values, weights):
        if w <= L:
            ret = max(dp_[L - w] + v, ret)
    return ret

Q = int(input())
for _ in range(Q):
    V, L = map(int, input().split())
    V -= 1
    if V < n:
        print(dp[V, L])
    else:
        Vs = []
        while V >= n:
            Vs.append(V)
            V = (V-1) // 2
        vs = vws_arr[Vs, 0]
        ws = vws_arr[Vs, 1]
        print(func(vs, ws, L, dp[V]))
N = input()
turi = N mod 1000
if (turi <> 0):
	turi = 1000 - turi
print(turi)

### FIXED CODE ###

N = int(input())
turi = N % 1000
if turi != 0:
  turi = 1000 - turi
print(turi)
n = int(input())
b = list(map(int,input().split()))
ans=[0] * n
ans[0] = b[0]
ans[1] = b[0]
ans1 = 0

for i in range(1,n-1):
  if i == n-2:
    ans1 += b[i]
    break
  if b[i] >= max([ans[i],ans[i+1]]):
    ans += min([b[i],b[i+1]])

print(sum(ans) + ans1)
  

### FIXED CODE ###

n=int(input())
b=[int(i) for i in input().split()]
ans=b[-1]+b[0]
for i,j in zip(b[:-1],b[1:]):
  ans+=min(i,j)
print(ans)
n,k = map(int, iuput().split(" "))
if k == 1:
  print(0)
else:
  print(n - k)
  
    

### FIXED CODE ###

n,k = map(int, input().split(" "))
if k == 1:
  print(0)
else:
  print(n - k)
import math

N = int(input()) 
D = int(input()) 

array = [[0]*10]*10
dis = 0
sum_dis = 0
for i in range(N-1):
    for j in range(i+1,N):
        for k in range(D):
            dis += (array[i][k] - array[i][k])**2
        dis = math.sqrt(dis)
        if(type(dis) == int): sum_dis += 1
print(sum_dis)

### FIXED CODE ###

import math

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

array = [[0 for i in range(10)] for j in range(10)]

for i in range(N):
    x = list(map(int, input().split()))
    for j in range(0, D):
        array[i][j] = x[j];
sum_dis = 0
for i in range(0,N-1):
    for j in range(i+1,N):
        dis = 0
        for k in range(D):
            dis += (array[i][k] - array[j][k])**2
        dis = math.sqrt(dis)
        if(dis.is_integer()): sum_dis += 1
print(sum_dis)
A,B,C = map(int,input().split())
ans =1
if A != B:
  ans += 1
if A != C and B != C:
  ans += 1
print(ANS)

### FIXED CODE ###

A,B,C = map(int,input().split())
ans =1
if A != B:
  ans += 1
if A != C and B != C:
  ans += 1
print(ans)
A, B, C = map(int, raw_input().split())
if A * B < C:
  print(A*B)
else:
  print(C)
  

### FIXED CODE ###

A, B, C = map(int, input().split())
if A * B < C:
    print(A * B)
else:
    print(C)
import numpy as np
n,k = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(n)]
ary_x = sorted(ary)
ary_y = sorted(ary,key=lambda x:(x[1],x[0]))
num = np.array(ary,dtype=float)
ans = float("Inf")

for xi in range(n):
    for xj in range(1,n):
        for yi in range(n):
            for yj in range(1,n):
                count = 0
                lx,rx = ary_x[xi][0],ary_x[xj][0]
                by,uy = ary_y[yi][1],ary_y[yj][1]

                for i in range(n):
                    if lx <= ary[i][0] <= rx and by <= ary[i][1] <= uy:
                        count += 1
                if count >= k:
                    ans = min(ans,(rx - lx) * (uy - by))
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(n)]
ary.sort()

ans = float("Inf")
for i in range(n-k+1):
    for j in range(k,n-i+1):
        xmin = ary[i][0]
        xmax = ary[i+j-1][0]
        ary_y = sorted(ary[i:i+j], key=lambda x: (x[1]))
        for l in range(len(ary_y)-k+1):
            ymin = ary_y[l][1]
            ymax = ary_y[l+k-1][1]
            ans = min(ans,(xmax - xmin) * (ymax - ymin))
print(ans)
s = input()
a = int(len(s))
x = []
while i <= a:
  if i == 0:
    i = 1
    x.append(s[i])
  else:
    i += 2
    x.append(s[i])
print(x,end=',')

### FIXED CODE ###

s = input()
print(s[::2])
def fib(n):
   a, b = 2, 1
   for i in range(n):
     a, b = b, a+b
    print(b)

fib(int(input())-1)

### FIXED CODE ###

def fib(n):
   a, b = 2, 1
   for i in range(n):
     a, b = b, a+b
   print(b)
 
fib(int(input())-1)
print('YES'if input()==input[::-1] else'NO')

### FIXED CODE ###

print(['NO','YES'][input()==input()[::-1]])
A, B, C = map(int, input().split())

print(min((A+B, C) + min(B, C)))


### FIXED CODE ###

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

print(min(A+B+1, C) + B)
import os
import sys
import ipdb


def dump(x):
    print >> sys.stderr, "{0}".format(x)

S = raw_input()
correct = "CODEFESTIVAL2016"
false_count = 0
for i, s in enumerate(S):
    if s != correct[i]:
        false_count += 1

print(false_count)

### FIXED CODE ###

import sys


def dump(x):
    print >> sys.stderr, "{0}".format(x)

S = raw_input()
correct = "CODEFESTIVAL2016"
false_count = 0

for i in range(min(len(S), len(correct))):
    if S[i] != correct[i]:
        false_count += 1

print(false_count)
n=int(input())
w = [(input()) for _ in range(n)]
l = set(w)
if len(w) != len(l):
        print('No')
        exit()
for i in range(n-1):
        if w[i][len(w[i]-1)] != w[i+1][0]:
                print('No')
                exit()
print('Yes')

### FIXED CODE ###

n=int(input())
w = [(input()) for _ in range(n)]
l = set(w)
if len(w) != len(l):
        print('No')
        exit()
for i in range(n-1):
        if w[i][len(w[i])-1] != w[i+1][0]:
                print('No')
                exit()
print('Yes')
a = input()
a = int(a)
if a >= 3200:
  s = input()
  print(s)
 else:
  print('red')

### FIXED CODE ###

a = input()
a = int(a)
if a >= 3200:
  s = input()
  print(s)
else:
  print('red')
import sys

n , m = map(int,input().split())

g = [[] for i in range(n+1)]

dp = [-1] * (n+1)
for _ in range(m):
    v1 , v2 = map(int,input().split())
    g[v1].append(v2)
    
# finding longest path for vertice i
def dfs(i):
    if dp[i]!=-1:
        return dp[i]
    temp = 0
    for nv in g[i]:
        temp = max(temp, dfs(nv)+1)

    dp[i]=temp
    return temp
  
# finding overall longest path  
res = 0  
for i in range(1,n+1):
    res = max(res, dfs(i))
print(res)

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**9)

n , m = map(int,input().split())

g = [[] for i in range(n+1)]

dp = [-1] * (n+1)
for _ in range(m):
    v1 , v2 = map(int,input().split())
    g[v1].append(v2)
    
# finding longest path for vertice i
def dfs(i):
    if dp[i]!=-1:
        return dp[i]
    temp = 0
    for nv in g[i]:
        temp = max(temp, dfs(nv)+1)

    dp[i]=temp
    return temp
  
# finding overall longest path  
res = 0  
for i in range(1,n+1):
    res = max(res, dfs(i))
print(res)
k,x=map(int,input().split())
for i in range(k)
	print(x+i-k+1,end="")
if k != 1:
	print(" ",end="")
	for s in range(k)[1:]
    	print(x+s,end="")
    

### FIXED CODE ###

k,x=map(int,input().split())
for i in range(k):
	print(x+i-k+1,end=" ")
if k != 1:
	print("",end="")
	for s in range(k)[1:]:
		print(x+s,end=" ")
x, a = (int(i) for i in input().split())  
if x < a:
  print(0)
else:
  pritn(10)

### FIXED CODE ###

x, a = (int(i) for i in input().split())  
if x < a:
  print(0)
else:
  print(10)
S = input()
li = list(S)
count = 0
re_num = 0
for num in range(2):
    if li[num] = "R" :
        count = count + 1

if count = 0 :
    re_num = 0
elif count = 1 :
    re_num = 1
elif count = 2 and li[2] = "S" :
    re_num = 1
elif count = 2 and li[2] = "R" :
    re_num = 2
else re_num = 3

print(re_num)

### FIXED CODE ###

S = input()
li = list(S)
count = 0
re_num = 0
for num in range(3):
    if li[num] == "R" :
        count = count + 1

if count == 0 :
    re_num = 0
elif count == 1 :
    re_num = 1
elif count == 2 and li[1] == "S" :
    re_num = 1
elif count == 2 and li[1] == "R" :
    re_num = 2
else :
    re_num = 3

print(re_num)
a = int(input())
b = int(input())

x=a*b

if X%2==0:
  print("Even")
else:
  print("Odd)

### FIXED CODE ###

a, b = map(int, input().split())
 
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
N=int(input())
X=[]
for i in range(1,9):
  for j in range(1,9):
    X.append(i*j)
if N in X:
  print("Yes")
else:
  prinnt("No")

### FIXED CODE ###

N=int(input())
A="No"
for i in range(1,10):
  for j in range(1,10):
    if i*j==N:
      A="Yes"
print(A)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
ls = [x+1 for x in range(N)]
candidates = [str(x) for x in ls if "7" in str(x) and "5" in str(x) and "3" in str(x)]
count = 0
for _ in range len(candidates):
    candlist = list(candidates)
    ls2 = [x for x in candlist if x != "7" and x != "5"and x != "3"]
    if ls2 is False:
        count += 1

print(count)


### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())

def dfs(s):
    if int(s) > N:
        return 0
    ret =1 if all (s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs (s+c)
    return ret

print(dfs('0'))
N,M=map(int,input().split())

a,b=map(int,input().split())
A=[a]
B=[b]

l=[1 for i in range(N+1)]

L=[[]for i in range(N+1)]

for i in range(M-1):
    x,y=map(int,input().split())
    L[x].append(y)
    L[y].append(x)
    
l[a]=0
l[b]=0


P=a
for i in range(10**5):
    for j in L[P]:
        if l[j]==0:
            pass
        else:
            P=j
            l[j]=0
            A.append(j)
            break
    if max(L[P])==0:
        break
P=b
for i in range(10**5):
    for j in L[P]:
        if l[j]==0:
            pass
        else:
            P=j
            l[j]=0
            B.append(j)
            break
    if max(L[P])==0:
        break
A=A[::-1]
ans=A+B
print(len(ans))

ANS=str(ans[0])
for i in range(1,len(ans)):
    ANS+=" "+str(ans[i])
print(ANS)
        
    

### FIXED CODE ###

import sys
input=sys.stdin.readline

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

R=[1 for i in range(N+1)]
A,B=map(int,input().split())
R[A]=0
R[B]=0

L=[[]for i in range(N+1)]
L[A].append(B)
L[B].append(A)

for i in range(M-1):
    a,b=map(int,input().split())
    L[a].append(b)
    L[b].append(a)

l=[A]
P=A
#print(L)

for i in range(10**6):
    flag=0
    #print("P",L[P])
    for j in L[P]:
        #print("j",L,L[P],j,P)
        if R[j]==1:
            P=j
            R[j]=0
            l.append(j)
            flag+=1
            break
    if flag==0:
        break
#print(l)
r=[B]
P=B
for i in range(10**6):
    flag=0
    #print("P",L[P])
    for j in L[P]:
        #print("j",L,L[P],j,P)
        if R[j]==1:
            P=j
            R[j]=0
            r.append(j)
            flag+=1
            break
    if flag==0:
        break
#print(r)
l=l[::-1]
ans=l+r

ANS=str(ans[0])
for i in range(1,len(ans)):
    ANS+=" "+str(ans[i])
print(len(ans))
print(ANS)
import fractions

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

ans = List[0]
for i in range(1, N):
    ans = ans * List[i] // fractions.gcd(ans, List[i])

ans = ans // 2
aa = max(List) * 0.5

x = aa // ans
ans = x * ans


print(int((M / ans + 1) // 2))

### FIXED CODE ###

N, M = map(int, input().split())
A = list(set(map(lambda x : int(x)//2, input().split())))
def gcd(x, y):
  return x if y == 0 else gcd(y, x % y)
def lcm(x, y):
  return (x * y) // gcd(x, y)
l = A[0]
for a in A[1:]:
  l = lcm(l, a)
ans = (M // l + 1) // 2
for a in A[1:]:
  if (l // a) % 2 == 0:
    ans = 0
    break
print(ans)
#####segfunc######
def segfunc(x,y):
    if type(x) is int:
        return x+y
    res = len(set([x,y]))
    if x == None:
        res -= 1
    if y == None:
        res -= 1
    return res
def init(init_val):
    #set_val
    for i in range(len(init_val)):
        seg[i+num-1]=init_val[i]   
    #built
    for i in range(num-2,-1,-1) :
        seg[i]=segfunc(seg[2*i+1],seg[2*i+2]) 
    
def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = segfunc(seg[k*2+1],seg[k*2+2])
    
def query(p,q):
    if q<=p:
        return ide_ele
    p += num-1
    q += num-2
    res=ide_ele
    while q-p>1:
        if p&1 == 0:
            res = segfunc(res,seg[p])
        if q&1 == 1:
            res = segfunc(res,seg[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = segfunc(res,seg[p])
    else:
        res = segfunc(segfunc(res,seg[p]),seg[q])
    return res

#####単位元######
n = int(input())
s = list(input())
ide_ele = None
num =2**(n-1).bit_length()
seg=[ide_ele]*(2*num - 1)
init(s)
for i in range(int(input())):
    a,b,c = input().split()
    if a == "1":
        update(int(b)-1, c)
    else:
        if b == c:
            print(1)
        else:
            print(query(int(b)-1,int(c)-1))

### FIXED CODE ###

import sys
input = sys.stdin.readline
#####segfunc######
def segfunc(x,y):
    return x | y

def init(init_val):
    #set_val
    for i in range(len(init_val)):
        seg[i+num-1]=init_val[i]   
    #built
    for i in range(num-2,-1,-1) :
        seg[i]=segfunc(seg[2*i+1],seg[2*i+2]) 
    
def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = segfunc(seg[k*2+1],seg[k*2+2])
    
def query(p,q):
    if q<=p:
        return ide_ele
    p += num-1
    q += num-2
    res=ide_ele
    while q-p>1:
        if p&1 == 0:
            res = segfunc(res,seg[p])
        if q&1 == 1:
            res = segfunc(res,seg[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = segfunc(res,seg[p])
    else:
        res = segfunc(segfunc(res,seg[p]),seg[q])
    return res

#####単位元######
n = int(input())
s = list(input())[:-1]
ide_ele = 0
num =2**(n-1).bit_length()
seg=[ide_ele]*(2*num - 1)
s = [2 ** (ord(i) - ord('a')) for i in s]
init(s)
q = int(input())
for i in range(q):
    tmp = input()
    a,b,c = tmp[:-1].split()
    if a == "1":
        update(int(b)-1, 2 ** (ord(c) - ord('a')))
    else:
        if b == c:
            print(1)
        else:
            tmp = query(int(b)-1, int(c))
            tmp = format(tmp, 'b')
            print(tmp.count('1'))
n,w_max=map(int,input().split())
W,V=[],[]
for i in range(n):
  w,v=map(int,input().split())
  W.append(w)
  V.append(v)
w_tot=sum(W)
DP=[[0 for i in range(w_tot+1)] for j in range(n)]
DP[0][W[0]]=V[0]
for i in range(1,n):
  for j in range(w_tot+1):
    if j>W[i]:
      DP[i][j]=max(DP[i-1][j],DP[i-1][j-W[i]]+V[i])
    elif j==W[i]:
      DP[i][j]=max(DP[i-1][j],V[i])
    else:
      DP[i][j]=DP[i-1][j]
print(DP[n-1][w_max+1])

### FIXED CODE ###

n,w_max=map(int,input().split())
W,V=[],[]
for i in range(n):
  w,v=map(int,input().split())
  W.append(w)
  V.append(v)
DP=[[0 for i in range(w_max+1)] for j in range(n)]
for i in range(w_max+1):
  if i>=W[0]:
    DP[0][i]=V[0]
for i in range(1,n):
  for j in range(w_max+1):
    if j>W[i]:
      DP[i][j]=max(DP[i-1][j],DP[i-1][j-W[i]]+V[i])
    elif j==W[i]:
      DP[i][j]=max(DP[i-1][j],V[i])
    else:
      DP[i][j]=DP[i-1][j]
print(DP[n-1][w_max])
# -*- coding: <encoding name> -*-
a,b=map(int,input().split())

if a*b%2=0:
	print('Even')
else:
  	print('Odd')

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
a,b=map(int,input().split())
 
if (a*b)%2==0:
	print('Even')
else:
  	print('Odd')