Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python

n = int(input())

tScore = 0
hScore = 0

for i in range(n):
    T, H = input().split()
    if T == H:
        tScore += 1
        hScore += 1
    else:
        j = 0
        while True:
            if T[j] != H[j]:
                if ord(T[j]) > ord(H[j]):
                    tScore += 3
                else:
                    hScore += 3
                break
            j += 1
print("%d %d" % (tScore, hScore))

### FIXED CODE ###

#!/usr/bin/env python

n = int(input())

tScore = 0
hScore = 0

for i in range(n):
    T, H = input().split()
    if T == H:
        tScore += 1
        hScore += 1
    elif T > H:
        tScore += 3
    elif H > T:
        hScore +=3
print("%d %d" % (tScore, hScore))
s = raw_input()
    n = int(raw_input())

    a,b = s.split(' ')
    a,b = int(a),int(b)

    if a <= 9 and a >=1 and (1 <= b <= 9):
        return a * b
    else:
        return -1

### FIXED CODE ###

entrada = input().split();
numeros =[int(entrada[0]),int(entrada[1])] 
if(numeros[0]>=1 and numeros[0]<=9 and numeros[1]>=1 and numeros[1]<=9):
	print(numeros[0]*numeros[1])
else:
	print(-1)
n = int(input())
if n % 615 == 0:
	print(1)
else:
	if n%100 == 0 or n%101==0 or n%102 == 0 or n%103==0 or n%104==0 or n%105==0:
		print(1)
	elif n%206==0 or n%207==0 or n%208==0 or n%201 ==0 or n%202 == 0 or n%203==0 or n%204 == 0 or n%205 == 0:
		print(1)
	elif n%303 == 0 or n% n%304 ==0 or n%305 == 0 or n%306 == 0 or n%307==0 or n%308==0 or n%309==0 or n%310 == 0 or n%311==0 or n%312==0:
		print(1)
	elif n%406==0 or n%407==0 or n%408==0 or n%409==0 or n%410==0 or n%411==0or n%412==0 or n%413==0 or n%414==0:
		print(1)
	elif n%510==0or n%511==0 or n%512==0 or n%513==0 or n%514==0 or n%515==0:
		print(1)
	else:
		print(0)

### FIXED CODE ###

coin = [100, 101, 102, 103, 104, 105]
X = int(input())
dp = [0]*(X+5)
dp[0]=1
for i in coin:
	for j in range(X+5):
		if i<=j:
			if dp[j-i]:
				dp[j]=1
print(1) if dp[X] else print(0)
N,K=map(int, input().split())
List=list(map(int,input().split())) 
print(sum(1 for x in List if x>=K))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
ans=[0 for i in range(N)]

for a in range(N):
    ans[A[a]-1]=a+1

print(*ans)
from functools import reduce
import math


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

    
def main():
    n = int(input())
    a = [int(x) for x in input().split()]

    v = lcm(*a) -1
    ans = sum(v % x for x in a)
    print(ans)
    
        
if __name__ == '__main__':
    main()


### FIXED CODE ###

from functools import reduce

import fractions

def gcd(x, y):
 
    if x > y:
        small = y
    else:
        small = x
    for i in range(1, small+1):
        if((x % i == 0) and (y % i == 0)):
            gcd = i
             
    return gcd
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

    
def main():
    n = int(input())
    a = [int(x) for x in input().split()]

    v = lcm(*a) -1
    ans = sum(v % x for x in a)
    print(ans)
    
        
if __name__ == '__main__':
    main()
x,y,z = map(int,input().split())


temp = x
x = z
z = temp

temp = z
z = y
y = temp

print(f"{x} {y} {z}")

### FIXED CODE ###

x,y,z = map(int,input().split())


temp = x
x = z
z = temp

temp = z
z = y
y = temp

print(x,y,z)
X,Y,Z= map(int, input().split())
print(max((X-1)//(Z+Y))

### FIXED CODE ###

X,Y,Z= map(int, input().split())
print((X-Z)//(Z+Y))
import array
import textwrap
import math
mod = 10 ** 9 + 7
def prime(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = array.array(typecode)
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes.tolist()

n = int(input())
a = prime(n)
ans = 1
print(a)
for i in a:
  b = 0
  c = i
  while c <= n:
    b += n // c
    c = c * i
  ans *= b + 1
  ans %= mod
print(ans)

### FIXED CODE ###

import array
import textwrap
import math
mod = 10 ** 9 + 7
def prime(end, typecode="L"):
    assert end > 1
    # 整数iが素数であるかをis_prime[i]が示す
    # 最初はすべてTrueで初期化しておく
    # 最終的にprimesではなくこれを返してもよい
    is_prime = array.array("B", (True for i in range(end)))
    # 0, 1はいずれも素数ではない
    is_prime[0] = False
    is_prime[1] = False
    # 素数を格納する配列
    primes = array.array(typecode)
    # 篩う
    for i in range(2, end):
        if is_prime[i]:  # iが素数であるとき
            primes.append(i)  # 素数の配列に加える
            for j in range(2 * i, end, i):  # iを超えるiの倍数について
                is_prime[j] = False  # 素数ではないため除外する
    return primes.tolist()

n = int(input())
a = prime(n+1)
ans = 1
for i in a:
  b = 0
  c = i
  while c <= n:
    b += n // c
    c = c * i
  b += 1
  ans *= b
  ans %= mod
print(ans)
N, M = map(int, input().split())
p_list = []
S = []
for _ in range(M):
    n, s = input().split()
    p_list.append(int(n))
    S.append(s)

wa = 0
ac = 0
ac_list = []
for i, p in enumerate(p_list):
    if p not in ac_list:
        if S[i] == "WA":
                wa += 1
        else:
                ac += 1
                ac_list.append(p)

print(ac, wa)

### FIXED CODE ###

s = input()
print(chr(ord(s) + 1))
n, m = map(int, input().split())
alist = set([int(input()) for _ in range(m)])

MOD = pow(10, 9) + 7

memo = [0 for _ in range(n)]
memo[0] = 0 if 1 in alist else 1
is_reach = True
if 1 in alist and 2 in alist:
  is_reach = False
  memo[0] = 0
elif 1 in alist:
  memo[1] = 1
else:
  memo[1] = 2

for i in range(2, n):
  if i+1 in alist:
    memo[i] = 0
  elif i in alist and i-1 in alist:
    memo[i] = 0
    is_reach = False
    break
  elif i in alist:
    memo[i] = memo[i-2]
  elif i-1 in alist:
    memo[i] = memo[i-1]
  else:
    memo[i] = (memo[i-1] + memo[i-2]) % MOD

if is_reach:
  print(memo[-1])
else:
  print(0)


### FIXED CODE ###

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

MOD = pow(10, 9) + 7

if n == 1:
  if 1 in alist:
    print(0)
  else:
    print(1)
else:
  memo = [0 for _ in range(n)]
  memo[0] = 0 if 1 in alist else 1
  is_reach = True
  if 1 in alist and 2 in alist:
    is_reach = False
    memo[0] = 0
  elif 1 in alist:
    memo[1] = 1
  else:
    memo[1] = 2

  for i in range(2, n):
    if i+1 in alist:
      memo[i] = 0
    elif i in alist and i-1 in alist:
      memo[i] = 0
      is_reach = False
      break
    elif i in alist:
      memo[i] = memo[i-2]
    elif i-1 in alist:
      memo[i] = memo[i-1]
    else:
      memo[i] = (memo[i-1] + memo[i-2]) % MOD

  if is_reach:
    print(memo[-1])
  else:
    print(0)
N=int(input())
l=list()
for i in range(N):
    l.append(int(input()))

num=list()
M=max(l)
for k in range(N):
    if(k[i]==M):
        num=l[:k]+l[k+1:]
        print(max(num))
    else:
        print(M)


### FIXED CODE ###

N=int(input())
l=list()
for i in range(N):
    l.append(int(input()))
a=sorted(l)
m1=a[-1]
m2=a[-2]
for k in range(N):
    if(m1==l[k]):
        print(m2)
    else:
        print(m1)
l=list(map(int,input().split()))
n=l[0]
legs=l[1]
(2*a)+(2*(n-a))==legs
if(l[1]%2!=0):
    print("No")
if(l[1]%2==0 and l[0]*4>=l[1]):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

l=list(map(int,input().split()))
n=l[0]
legs=l[1]
if(n==0 and legs==0):
    print("Yes")
if(legs%2==0 and l[0]*4>=l[1] and l[0]*2<=l[1]):
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
S, C = [], []
for _ in range(M):
    s, c = map(int, input().split())
    if s in S:
        if C[S.index(s)] != c:
            print(-1)
            exit()
        else:
            continue
    S.append(s)
    C.append(c)

z = zip(S, C)
z = sorted(z)
S, C = zip(*z)

ans = [-1] * N
for i in range(len(S)):
    ans[S[i]-1] = C[i]

if ans[0] == 0:
    print(-1)
    exit()

if ans[0] == -1 and ans[1] == -1 and ans[2] == -1:
    print(-1)
    exit()
if ans[0] == -1 and ans[1] == -1:
    print(ans[2])
    exit()
if ans[0] == -1:
    print(str(ans[1]) + str(max(0, ans[2])))
    exit()
print(str(ans[0]) + str(max(0, ans[1])) + str(max(0, ans[2])))

### FIXED CODE ###

N, M = map(int, input().split())
S, C = [], []
for _ in range(M):
    s, c = map(int, input().split())
    s -= 1
    if s in S:
        if C[S.index(s)] != c:
            print(-1)
            exit()
        else:
            continue
    S.append(s)
    C.append(c)

if len(S) == 0:
    if N == 1:
        print(0)
    elif N == 2:
        print(10)
    else:
        print(100)
    exit()

ans = [-1] * N
for i in range(len(S)):
    ans[S[i]] = C[i]

if N == 1:
    if ans[0] == 0:
        print(0)
        exit()

if ans[0] == -1:
    ans[0] = 1
elif ans[0] == 0:
    print(-1)
    exit()

ans = [a if a != -1 else 0 for a in ans]
print(''.join(list(map(str, ans))))
A, B = map(int, input().split())

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

isPrime = [True for i in range(num + 1)]
isPrime[2] = True
for i in range(2, num+1):
    if isPrime[i]:
        for j in range(2 * i, num+1, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count)


### FIXED CODE ###

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

def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

num = gcd(A, B)

if num < 2:
    print(1)
    quit()

length = int(num ** 0.5) + 2
isPrime = [True for i in range(length)]
isPrime[2] = True
for i in range(2, length):
    if isPrime[i]:
        for j in range(2 * i, length, i):
            isPrime[j] = False

count = 1

cur = 2
while num != 1 and cur < length:
    if isPrime[cur] and num % cur == 0:
        while num % cur == 0:
            num //= cur
        count += 1
    cur += 1

print(count + (num != 1))
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

if h == 1 and w == 1:
    if s[0][0] == '.':
        print(1)
    else:
        print(0)
    exit()
elif h == 1:
    print(s[100000][1000000])
    a = [0] * w
    mode = 0
    for i in range(w):
        if mode == 0:
            if s[0][i] == '.':
                c = 1
                a[i] = c
                mode = 1
        else:
            if s[0][i] == '.':
                c += 1
                a[i] = c
            else:
                mode = 0
    print(max(a))
    exit()
elif w == 1:
    b = [0] * h
    mode = 0
    for i in range(h):
        if mode == 0:
            if s[i][0] == '.':
                c = 1
                b[i] = c
                mode = 1
        else:
            if s[i][0] == '.':
                c += 1
                b[i] = c
            else:
                mode = 0
    print(max(b))
    exit()

exit()

a = [[0 for _ in range(w)] for _ in range(h)]
b = [[0 for _ in range(w)] for _ in range(h)]

c = 0

for i in range(h):
    mode = 0
    for j in range(w):
        if mode == 0:
            if s[i][j] == '.':
                c = 1
                a[i][j] = 1
                mode = 1
        else:
            if s[i][j] == '.':
                c += 1
                a[i][j] = c
            else:
                mode = 0

    for j in range(w-2, -1, -1):
        if a[i][j+1] > 0 and a[i][j] > 0:
            a[i][j] = a[i][j+1]

ans = 0

for j in range(w):
    mode = 0
    for i in range(h):
        if mode == 0:
            if s[i][j] == '.':
                c = 1
                b[i][j] = c
                mode = 1
        else:
            if s[i][j] == '.':
                c += 1
                b[i][j] = c
            else:
                mode = 0

    #print(b)

    for i in range(h-2, -1, -1):
        if b[i+1][j] > 0 and b[i][j] > 0:
            b[i][j] = b[i+1][j]
            ans = max(ans, a[i][j] + b[i][j] - 1)
        elif b[i][j] > 0:
            ans = max(ans, a[i][j] + b[i][j] - 1)

print(ans)

### FIXED CODE ###

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

L = [[0 for _ in range(w)] for _ in range(h)]
R = [[0 for _ in range(w)] for _ in range(h)]
D = [[0 for _ in range(w)] for _ in range(h)]
U = [[0 for _ in range(w)] for _ in range(h)]

for i in range(h):
    if s[i][0] == '.':
        L[i][0] = 1
    for j in range(1, w):
        if s[i][j] == '.':
            L[i][j] = L[i][j-1] + 1
    if s[i][w-1] == '.':
        R[i][w-1] = 1
    for j in range(w-2, -1, -1):
        if s[i][j] == '.':
            R[i][j] = R[i][j+1] + 1

for j in range(w):
    if s[0][j] == '.':
        U[0][j] = 1
    for i in range(1, h):
        if s[i][j] == '.':
            U[i][j] = U[i-1][j] + 1
    if s[h-1][j] == '.':
        D[h-1][j] = 1
    for i in range(h-2, -1, -1):
        if s[i][j] == '.':
            D[i][j] = D[i+1][j] + 1

ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)

print(ans)
from sys import stdin
import numpy as np

def bit_search(a, n, m, x):
    min_price = float('inf')
    for i in range(2 ** n):
        price = 0
        skill = np.zeros((n, m))
        for j in range(n):
            if (i >> j) & 1:
                price += a[j][0]
                skill[j] = a[j][1:]
        skill_sum = np.sum(skill, axis=0)\
                        if skill.shape[0] > 1 else np_skill
        if not (skill_sum >= x).all() or price > min_price: continue
        min_price = price
    return min_price

def main():
    readline = stdin.readline
    n, m, x = map(int, readline().split())
    a = [list(map(int, readline().split())) for _ in range(n)]
    min_price = bit_search(a, n, m, x)
    return print('-1' if min_price == float('inf') else min_price)

if __name__ == '__main__':
    main()


### FIXED CODE ###

from sys import stdin
import numpy as np

def main():
    readline = stdin.readline
    n, m, x = map(int, readline().split())
    a = [list(map(int, readline().split())) for _ in range(n)]
    res = []
    for i in range(2 ** n):
        price = 0
        skill = []

        for j in range(n):
            if ((i >> j) & 1):
                price += a[j][0]
                skill.append(a[j][1:])
        np_skill = np.array(skill)
        skill_sum = np.sum(np_skill, axis=0)\
                        if np_skill.shape[0] > 1 else np_skill

        if skill_sum.size != 0 and (skill_sum >= x).all():
            res.append(price)

    if not res: return print('-1')

    return print(min(res))

if __name__ == '__main__':
    main()
from collections import Counter

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

C = Counter(A)
C = sorted(C.items())

cc = []
for a, b in C:
    cc.append([a, b])
C = cc

M = len(C)

left = 0
right = M - 1

while True:
    if C[left][1] < 2:
        for left in range(M):
            if C[left][1] > 1:
                break

    if C[right][1] < 2:
        for right in range(M):
            if C[M - right - 1][1] > 1:
                break

        right = M - right - 1

    if C[left][1] <= 1 and C[right][1] <= 1:
        break

    if left == right:
        if C[left][1] >= 3:
            C[left][1] -= 2
        else:
            C[left][1] -= 1
            for i in range(left + 1, M):
                if C[left + i][1] > 0:
                    C[left + i][1] -= 1
                    break
    else:
        C[left][1] -= 1
        C[right][1] -= 1


ans = 0
for a, b in C:
    ans += b

print(ans)


### FIXED CODE ###

from collections import Counter

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

C = Counter(A)
C = sorted(C.items())

cc = []
for a, b in C:
    cc.append([a, b])
C = cc

M = len(C)

left = 0
right = M - 1

while True:
    if C[left][1] < 2:
        p_left = left
        for left in range(p_left, M):
            if C[left][1] > 1:
                break

    if C[right][1] < 2:
        p_right = M - right - 1
        for right in range(M):
            if C[M - right - 1][1] > 1:
                break

        right = M - right - 1

    if C[left][1] <= 1 and C[right][1] <= 1:
        break

    if left == right:
        if C[left][1] >= 3:
            C[left][1] -= 2
        else:
            f = 0
            C[left][1] -= 1
            for i in range(left + 1, M):
                if C[i][1] > 0:
                    C[i][1] -= 1
                    f = 1
                    break

            if f == 0:
                for i in range(0, left):
                    if C[i][1] > 0:
                        C[i][1] -= 1

    else:
        C[left][1] -= 1
        C[right][1] -= 1


ans = 0
for a, b in C:
    ans += b

print(ans)
import numpy as np

card = np.array([list(map(int, input().split())) for i in range(3)])

n = int(input())

number = [int(input()) for i in range(n)]

hit = np.isin(card, number)

row = hit.all(axis=0).any()
col = hit.all(axis=1).any()

diag1 = hit[0][0] and hit[1][1] and hit[2][2]
diag2 = hit[0][2] and hit[1][1] and hit[2][0]

print('yes' if row or col or diag1 or diag2 else 'no')

### FIXED CODE ###

import numpy as np

card = np.array([list(map(int, input().split())) for i in range(3)])

n = int(input())

number = [int(input()) for i in range(n)]

hit = np.vectorize(lambda x: x in number)(card)

row = hit.all(axis=0).any()
col = hit.all(axis=1).any()

diag1 = hit[0][0] and hit[1][1] and hit[2][2]
diag2 = hit[0][2] and hit[1][1] and hit[2][0]

print('Yes' if row or col or diag1 or diag2 else 'No')
a, b = map(int, input().split())
cap = 0
count = 0
if b = 1:
    print(count)
else:
    while cap < b:
        cap += a
        if cap < b:
            cap -= 1
        count += 1
    print(count)

### FIXED CODE ###

a, b = map(int, input().split())
cap = 0
count = 0
if b == 1:
    print(count)
else:
    while cap < b:
        cap += a
        if cap < b:
            cap -= 1
        count += 1
    print(count)
[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
jmax=min(s-i+1,k+1)
for i in range(imax):
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

### FIXED CODE ###

[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
for i in range(imax):
	jmax=min(s-i+1,k+1)
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)
import sys
readline = sys.stdin.readline
write = sys.stdout.write

def num(key):
    if key == 1:
        return 2
    elif key == 7:
        return 3
    elif key == 4:
        return 4
    elif key == 9 or key == 6:
        return 6
    elif key == 8:
        return 7
    else:
        return 5

N, M, = readline().split()
N = int(N)
M = int(M)
A = list(map(int, readline().split()))
A.sort(reverse = True)
dp = [-float('inf'),] *(N+1)
dp[0] = 0
for i in range(A[-1], N+1):
    temp = []
    for j in range(M):
        if i - num(A[j]) >= 0:
            temp.append(dp[i-num(A[j])] + 1)
    if len(temp) > 0:
        dp[i] = max(temp)

digit = dp[N]
ans = [0,] *(digit)
for i in range(digit):
    for j in range(M):
        if dp[N-num(A[j])] == dp[N] - 1:
            ans[i] = A[j]
            N = N - num(A[j])
            break
for i in range(digit):
    write(str(ans[i]))
write("\n")

### FIXED CODE ###

import sys
readline = sys.stdin.readline
write = sys.stdout.write

def num(key):
    if key == 1:
        return 2
    elif key == 7:
        return 3
    elif key == 4:
        return 4
    elif key == 9 or key == 6:
        return 6
    elif key == 8:
        return 7
    else:
        return 5

N, M, = readline().split()
N = int(N)
M = int(M)
A = list(map(int, readline().split()))
A.sort(reverse = True)
dp = [-float('inf'),] *(N+1)
dp[0] = 0
for i in range(1, N+1):
    temp = []
    for j in range(M):
        if i - num(A[j]) >= 0:
            temp.append(dp[i-num(A[j])] + 1)
    if len(temp) > 0:
        dp[i] = max(temp)

digit = dp[N]
ans = []
for i in range(digit):
    for j in range(M):
        if N - num(A[j]) >= 0 and dp[N-num(A[j])] == dp[N] - 1:
            ans.append(A[j])
            N = N - num(A[j])
            break
for i in range(digit):
    write(str(ans[i]))
write("\n")
n=int(input())
l=[0]+list(map(int,input().split()))
from itertools import accumulate
l=list(accumulate(l))
from bisect import bisect, bisect_left, bisect_right
ans=10**15
for i in range(2,n-1):
  	x=bisect_left(l,l[i]//2)
    p1=l[x]
    p2=l[x-1]
    if abs(l[i]-p1*2)>=abs(l[i]-p2*2):
        p=p2
    else:
        p=p1
    q=l[i]-p
    x=bisect_left(l,(l[n]-l[i])//2+l[i])
    r1=l[x]-l[i]
    r2=l[x-1]-l[i]
    if abs(l[n]-l[i]-r1*2)>=abs(l[n]-l[i]-r2*2):
        r=r2
    else:
        r=r1
    s=l[n]-l[i]-r
    ans=min(ans,max(p,q,r,s)-min(p,q,r,s))
print(ans)

### FIXED CODE ###

n=int(input())
l=[0]+list(map(int,input().split()))
from itertools import accumulate
l=list(accumulate(l))
from bisect import bisect, bisect_left, bisect_right
ans=10**15
for i in range(2,n-1):
    x=bisect_left(l,l[i]//2)
    p1=l[x]
    p2=l[x-1]
    if abs(l[i]-p1*2)>=abs(l[i]-p2*2):
        p=p2
    else:
        p=p1
    q=l[i]-p
    x=bisect_left(l,(l[n]-l[i])//2+l[i])
    r1=l[x]-l[i]
    r2=l[x-1]-l[i]
    if abs(l[n]-l[i]-r1*2)>=abs(l[n]-l[i]-r2*2):
        r=r2
    else:
        r=r1
    s=l[n]-l[i]-r
    ans=min(ans,max(p,q,r,s)-min(p,q,r,s))
print(ans)
v=input()
v=int(v)
print(v**i '\n')

### FIXED CODE ###

x=eval(input())
print(x**3)
N,K=map(int,input().split())
n_b=N
a=N%k
if(K/2<a):
    print(a-k)
else:
    print(a)


### FIXED CODE ###

N,K=map(int,input().split())
n_b=N
a=N%K
if(K/2<a):
    print(abs(a-K))
else:
    print(a)
from math import gcd, ceil
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]
tmp = 1
for i in a:
    lcm = tmp * (a[i]//2) // gcd(tmp,a[i]//2)
    tmp = lcm
for i in a:
    if tmp // i % 2 == 0:
        print(0)
        exit()
print((m//tmp+1)//2)

### FIXED CODE ###

from math import gcd, ceil
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = [i // 2 for i in a]
l = 1
for i in a:
    l *= i // gcd(l, i)
for i in a:
    if l // i % 2 == 0:
        print(0)
        exit()
print(ceil((m // l) / 2))
N, K, S = map(int, input().split())

mawari = S // K
mid = S // K + S % K

ans = []

for i in range(K-1):
    ans.append(mawari)

ans.append(mid)

for i in range(K-1):
    ans.append(mawari)

for i in range(N - len(ans)):
    ans.append(10**9-1)

print(*ans)

### FIXED CODE ###

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

ans = []
for i in range(K):
    ans.append(S)
    
for i in range(N - len(ans)):
    ans.append(10**9-1)

print(*ans)
def main():
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a%b)

    def lcm(a, b):
        return int(a / gcd(a, b)) * b
    
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_ = A.pop()
    for a in A:
        a_lcm = lcm(a_, a)
        a_ = a_lcm
    if a_lcm / 2 > m:
        print(0)
    else:
        ans = int((m - (a_lcm / 2))) // a_lcm + 1
        print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()