Harryxun/stf_run huggingface dataset:
import numpy as np

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

# White : 1
# Black : 2

def count(field):


    return white, black

field = np.ones([100,100])

def print_():
    print("100 100")
    p = lambda x : "." if x == 1 else "#"
    for f in field:
        print("".join(list(map(p, f))))


A -= 1

x, y = 0, 0 #一つ飛ばしで黒にするところの座標
x_, y_ = 1, 0 #白がたりなくて埋めていくときの座標

while True:
    if A == 0 and B == 0:
        break

    if B > 0 and A > 0:
        if y == 0 or x == 0 or y == 99 or x == 99:
            field[y][x] = 2
            B -= 1
        else:
            field[y][x] = 2
            if field[y-1][x] == 1:
                A -= 1
                B -= 1
            else:
                pass
        x += 2
        if x >= 100:
            y += 1
            x = y%2

    elif B > 0:
        if y == 0 or x == 0 or y == 99 or x == 99:
            field[y][x] = 2
            B -= 1
        x += 2
        if x >= 100:
            y += 2
            x = 0

    elif A > 0:
        field[y_][x_] = 2
        if field[y_+1][x_] == 2 :
            A += 1
        count = 0
        for h, v in zip([0, 1], [1, 0]):
            if h+y_ < 0 or h+y_ >= 100 or v+x_ < 0 or v+x_ >= 100:
                continue
            if field[h+y_][v+x_] == 2:
                count += 1
        B += count
        x_ += 2
        if x_ >= 100:
            y_ += 1
            x_ = 1-y_%2

    else:
        print(A,B)
        raise
    print(A,B)


print_()

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())

price = min(A, B) + min(C, D)
print(price)
a, b = map(int, input().split(' ')
print(a*(a-1)/2 + b*(b-1)/2)

### FIXED CODE ###

a, b = map(int, input().split(' '))
print(int(a*(a-1)/2 + b*(b-1)/2))
from heapq import heappop,heappush
n = int(input())
A = sorted(list(map(int,input().split())))
p = 0
P = []
m = 0
M = []
for a in A:
    if a>=0:
        p += 1
        P.append(a)
    else:
        m += 1
        M.append(a)
if m!=0 and p!=0:
    res = 0
    for a in A:
        res += abs(a)
    print(res)
    while p!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        p -= 1
        heappush(M,mm-pp)
    while m != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        m -= 1
        heappush(P,pp-mm)
elif m == 0:
    print(sum(P)-min(P)*2)
    mm = heappop(P)
    pp = heappop(P)
    print(mm,pp)
    p -= 2
    m += 1
    heappush(M,mm-pp)
    while p!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        p -= 1
        heappush(M,mm-pp)
    while m != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        m -= 1
        heappush(P,pp-mm)
else:
    res = 0
    MMM = -100000000
    for m in M:
        MMM = max(MMM,m)
        res += abs(m)
    print(res+MMM*2)
    M.sort()
    mm = M[-1]
    pp = M[-2]
    print(mm,pp)
    m -= 2
    p += 1
    M = M[:-2]
    heappush(P,mm-pp)
    while p!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        p -= 1
        heappush(M,mm-pp)
    while m != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        m -= 1
        if m==0:
            break
        heappush(P,pp-mm)

### FIXED CODE ###

from heapq import heappop,heappush
n = int(input())
A = sorted(list(map(int,input().split())))
P = []
M = []
if n == 2:
    print(A[1]-A[0])
    print(A[1],A[0])
    exit()
def move():
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
for a in A:
    if a>=0:
        P.append(a)
    else:
        M.append(a)

if A[-1]>=0 and A[0]<0:
    print(sum(abs(a) for a in A))
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
elif A[0]>=0:
    print(sum(A)-min(A)*2)
    mm = heappop(P)
    pp = heappop(P)
    print(mm,pp)
    heappush(M,mm-pp)
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
else:
    print(sum(abs(a) for a in A)+max(A)*2)
    mm = M[-1]
    pp = M[-2]
    print(mm,pp)
    M = M[:-2]
    heappush(P,mm-pp)
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
K = int(input())
X = int(input())
if 500 * K >= X:
  print(Yes)
else:
  print(Yes)

### FIXED CODE ###

K, X = map(int, input().split())
print("Yes" if K * 500 >= X else "No")
v=list(map(int,input().split(' ')))
if v[0]==v[1]:
    print('H')
else:
    print('D')

### FIXED CODE ###

v=list(input().split(' '))
if v[0]==v[1]:
    print('H')
else:
    print('D')
import math

N = int(input())

anss = []
for n in range(1,math.ceil(N**0.5)):
	if N % n == 0:
		anss.append(max(len(str(n)),len(str(N//n))))
		
print(min(anss))

### FIXED CODE ###

import math

N = int(input())

anss = []
for n in range(1,math.ceil(N**0.5)+1):
	if N % n == 0:
		anss.append(max(len(str(n)),len(str(N//n))))

if len(anss) == 0:
	anss.append(1)
		
print(min(anss))
import numpy as np
x,n =map(int,input().split())

if  n==0:
 print(x)
else:
 P =list(map(int,input().split()))
 l = list(range(2*x))
 result = list(set(l) - set(P))
 abs = list(np.abs(np.array(result)-x))
 abs.remove(0)
 min = min(abs)
 print(abs)
 print(result[abs.index(min)])

### FIXED CODE ###

import numpy as np
x,n =map(int,input().split())

if  n==0:
 print(x)
else:
 P =list(map(int,input().split()))
 for i in range(100):
  if  (x-i) not in P:
   print(x-i)
   break
  elif (x+i) not in P:
   print(x+i)
   break
N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N = 1:
  coment = 'Yes'
  
elif N = 2:
  if num[0] - num[1] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i] - num[i+1] < -1:
      coment = 'No'
      break
    elif num[i] - num[i+1] < 0:
      if num[i+1] - num[i+2] < 0:
        coment = 'No'
        break

print(coment)
      

### FIXED CODE ###

N = int(input())
num = [int(i) for i in input().split()]
coment = 'Yes'

if N == 1:
  coment = 'Yes'
  
elif N == 2:
  if num[1] - num[0] < -1:
    coment = 'No'
    
else:
  for i in range(N-2):
    if num[i+1] - num[i] < -1:
      coment = 'No'
      break
    elif num[i+1] - num[i] < 0:
      for j in range(N-2-i):
        if num[i+2+j] - num[i+1] < 0:
          coment = 'No'
          break
        elif num[i+2+j] - num[i+1] > 0:
          break
          
print(coment)
N, K, X, Y = map(int, input().split())

A = K*X + (N-K)*Y
print(A)

### FIXED CODE ###

N = int(input())
K = int(input())
X = int(input())
Y = int(input())
 
if N > K:
  print(K*X + (N-K)*Y)
else:
  print(N*X)
import math

N = int(input())

P = list(map(int,input().split()))
Q = list(map(int,input().split()))

def check(A):
    L = [j+1 for j in range(N)]
    ans = 0
    for i in range(N):
        a = L.index(A[i])
        ans += a*math.factorial(N-1-i)
        L.pop(a)
    return ans
p = check(P)
q = check(Q)
print(abs(P-Q))

### FIXED CODE ###

import math

N = int(input())

P = list(map(int,input().split()))
Q = list(map(int,input().split()))

def check(A):
    L = [j+1 for j in range(N)]
    ans = 0
    for i in range(N):
        a = L.index(A[i])
        ans += a*math.factorial(N-1-i)
        L.pop(a)
    return ans
p = check(P)
q = check(Q)
print(abs(p-q))
N = int(input())
leng = 10**6+1
memo = [0]*leng
li = []
for n in map(int, input().split()):
    x = 0
    li.append(n)
    while x < leng:
        memo[x] +=1
        x += n
count = 0
for n in li:
    if memo[n] == 1:
        count+=1
print(count)

### FIXED CODE ###

li = [i for i in map(int, input().split())]

print(li.index(0)+1)
N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), returned=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

if K>max(A):
	print("IMPOSSIBLE")
	exit(0)

g=gcd(A[0],A[1])
for i in range(2,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")

### FIXED CODE ###

N, K=map(int, input().split())
A=list(sorted(list(map(int, input().split())), reverse=True))

def gcd(a,b):
	while b:
		a,b=b,a%b
	return a

g=A[0]
for i in range(1,len(A)):
	g=gcd(g,A[i])

print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")
n, m, k = map(int, input().split())

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

sumA=0
sumB=0
minAB=0

for i in range(n):
    sumA+=A[i]
for i in range(m):
    sumB+=B[i]
for i in range(min(n, m)):
    minAB+=A[i]+B[i]

if sumA+sumB<=k:
    ans=n+m
elif A[0]>k or B[0]>k:
    ans=0
else :
    if minAB>k:
        ans=min(n, m)
        if min(n, m)==n:
            for i in range(min(n, m), max(n, m)):
                if B[i]+minAB<k:
                    minAB+=B[i]
                    ans+=1
        else:
            for i in range(min(n, m), max(n, m)):
                if A[i]+minAB<k:
                    minAB+=B[i]
                    ans+=1
    else:
        for i in reversed(0, min(n,m)):
            if minAB-A[i]-B[i]>=k:
                minAB-=A[i]+B[i]
                ans-=2
            else:
                if minAB-A[i]<k or minAB-B[i]<k:
                    ans-=1
                else:
                    ans-=2
print(ans)


### FIXED CODE ###

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

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

a, b=[0],[0]
for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])

ans, j=0,m

for i in range(n+1):
    if a[i]>k:
        break
    while b[j]>k-a[i]:
        j-=1
    ans=max(ans, i+j)
print(ans)
import numpy as np
 
K=int(input())
 
S=0
for a in range(1,K+1):
    for b in range(1,K+1):
        calc=np.gcd(a,b)
        for c in range(1,K+1):
                S+=np.gcd(calc,c)
 
print(S)

### FIXED CODE ###

from math import gcd
 
K=int(input())
 
S=0
for a in range(1,K+1):
    for b in range(1,K+1):
        calc=gcd(a,b)
        for c in range(1,K+1):
                S+=gcd(calc,c)
 
print(S)
s = intput()
if s == "RRR":
  print(3)

elif s == "SRR" or s == "RSS":
  print(2)
elif s = "SSS":
  print(0)
else:
  print(1)

### FIXED CODE ###

s = input()

if s == "RRR":
  print(3)
elif s == "SRR" or s == "RRS":
  print(2)
elif s == "SSS":
  print(0)
else:
  print(1)
#!/usr/bin/env python3
import sys
import fractions
import math


def solve(N: int, A: "List[int]"):
    L = []
    last = A[0]
    for i in range(N):
        last = math.gcd(last, A[i])
        L.append(last)
    last = A[-1]
    R = []
    for i in range(1, N+1):
        last = math.gcd(last, A[-i])
        R.append(last)
    R.reverse()
    if N == 2:
        print(max(A[0], A[1]))
        return
    maxGCD = max(L[-2], R[-2])
    for i in range(1, N-1):
        maxGCD = max(math.gcd(L[i-1], R[i+1]), maxGCD)
    print(maxGCD)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import fractions
import math


def solve(N: int, A: "List[int]"):
    L = []
    last = A[0]
    for i in range(N):
        last = fractions.gcd(last, A[i])
        L.append(last)
    last = A[-1]
    R = []
    for i in range(1, N+1):
        last = fractions.gcd(last, A[-i])
        R.append(last)
    R.reverse()
    if N == 2:
        print(max(A[0], A[1]))
        return
    maxGCD = max(L[-2], R[1])
    for i in range(1, N-1):
        maxGCD = max(fractions.gcd(L[i-1], R[i+1]), maxGCD)
    print(maxGCD)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()
def compare(a,b):
  res = 0
  for x,y in zip(a,b):
    if x == y:
      res += 1
  return res

s,t = map(int, input().split())
len_t = len(t)
ans = 0
for i in range(len(s)-len(t)+1):
  ans = max(ans,compare(s[i:i+len_t],t))
print(ans)


### FIXED CODE ###

a,b,c = map(int, input().split())
print("Yes") if b * c >= a else print("No")
N = int(input())
A=[]  
A=[int(x) for x in input().split()]
num = 1
count = 0
for i in range(N):
  if A[i] == num:
    num += 1
  else:
    count += 1
if count >= N-1:
  print(-1)
else:
  print(count)
  

### FIXED CODE ###

print(6 - int(input())-int(input()))
N, M = map( int, input().split())
A = list( map( int, input().split()))
Needs = [0,2,5,5,4,5,6,3,7,6]
A.sort(reverse = True)
V = [0]*10
Check = []
for a in A:
    if V[Needs[a]] == 0:
        Check.append(Needs[a])
        V[Needs[a]] = a
Check.sort()
dp = [-100000]*(N+1)
dp[0] = 0

for x in Check:
    dp[x] = 1
for i in range(1,N):
    t = dp[i]
    for x in Check:
        if x + i <= N:
            if dp[x+i] < t + 1:
                dp[x+i] = t+1
ans = ""
t = N
W = [0]*10
while t > 0:
    for a in A:
        x = Needs[a]
        if dp[t-x]+1 == dp[t]:
            W[V[x]] += 1
            t -= x
            break
for i in range(9,0,-1):
    ans += str(i)*W[i]
print(ans)


### FIXED CODE ###

N, M = map( int, input().split())
A = list( map( int, input().split()))
Needs = [0,2,5,5,4,5,6,3,7,6]
A.sort(reverse = True)
V = [0]*10
Check = []
for a in A:
    if V[Needs[a]] == 0:
        Check.append(Needs[a])
        V[Needs[a]] = a
Check.sort()
dp = [-100000]*(N+1)
dp[0] = 0

for x in Check:
    if x <= N:
        dp[x] = 1
for i in range(1,N):
    t = dp[i]
    for x in Check:
        if x + i <= N:
            if dp[x+i] < t + 1:
                dp[x+i] = t+1
ans = ""
t = N
W = [0]*10
while t > 0:
    for a in A:
        x = Needs[a]
        if t-x>=0:
            if dp[t-x]+1 == dp[t]:
                W[V[x]] += 1
                t -= x
                break
for i in range(9,0,-1):
    ans += str(i)*W[i]
print(ans)
s = input().rstrip()

if a != b != c:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

s = input().rstrip()

if s[0] != s[1] and s[1] != s[2] and s[2] != s[0]:
    print('Yes')
else:
    print('No')
H, K = map(int, input().split())
hp = list(map(input().split()))
hp_sorted = sorted(hp, reverse=True)
print(sum(hp_sorted[K:]))


### FIXED CODE ###

H, K = map(int, input().split())
hp = list(map(int, input().split()))
hp.sort(reverse=True)
print(sum(hp[K:]))
b = input()
if b == "A":
    print "T"
elif b == "T":
    print "A"
if b == "C":
    print "G"
else:
    print "C"

### FIXED CODE ###

b = raw_input()
if b == "A":
    print "T"
elif b == "T":
    print "A"
if b == "C":
    print "G"
elif b == "G":
    print "C"
#!/usr/bin/env python3
from sys import stdin


def solve(tc):
    n = int(stdin.readline().strip())
    ai = list(map(int, stdin.readline().split()))

    adj = [[] for i in range(n)]
    for i in range(n - 1):
        adj[ai[i] - 1].append(i + 1)

    for children in adj:
        print(len(children))



LOCAL_TEST = not __debug__
if LOCAL_TEST:
    infile = __file__.split('.')[0] + "-test.in"
    stdin = open(infile, 'r')

tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1

### FIXED CODE ###

#!/usr/bin/env python3
from sys import stdin


def solve(tc):
    n = int(stdin.readline().strip())
    ai = list(map(int, stdin.readline().split()))

    adj = [[] for i in range(n)]
    for i in range(n - 1):
        adj[ai[i] - 1].append(i + 1)

    for children in adj:
        print(len(children))



LOCAL_TEST = not __debug__
if LOCAL_TEST:
    infile = __file__.split('.')[0] + "-test.in"
    stdin = open(infile, 'r')

tcs = 1
tc = 1
while tc <= tcs:
    solve(tc)
    tc += 1
N = int(input())
if N == 1:
	print("Hello World")
else:
	A = int(input())
    B = int(input())
    print(A+B)

### FIXED CODE ###

N = int(input())
if N == 1:
  print("Hello World")
else:
  A = int(input())
  B = int(input())
  print(A+B)
# coding: utf-8

# https://atcoder.jp/contests/abc097/tasks/arc097_b
# 15:36-15:48 give up => hint
# 15:53-16:16

import sys

sys.setrecursionlimit(10000)


def main():
    N, M = map(int, input().split())
    p = list(map(int, input().split()))
    p = [num-1 for num in p]
    x, y = [None] * M, [None] * M
    for i in range(M):
        x[i], y[i] = map(int, input().split())
        x[i] -= 1  # 0-index
        y[i] -= 1  # 0-index

    edges = {node: [] for node in range(N)}
    for xi, yi in zip(x, y):
        edges[xi].append(yi)
        edges[yi].append(xi)

    def rec(parent_node):
        children = edges[parent_node]
        for child in children:
            if check_node[child] is not None:
                continue

            indexes.append(child)
            numbers.append(p[child])
            check_node[child] = 1

            rec(child)

    ans = 0
    check_node = [None] * N
    for start in range(N):
        if check_node[start] is not None:
            continue

        # joint = [start]
        check_node[start] = 1
        indexes = [start]
        numbers = [p[start]]
        rec(start)

        ans += len(set(indexes) & set(numbers))

    return ans


print(main())


### FIXED CODE ###

# coding: utf-8

# https://atcoder.jp/contests/abc097/tasks/arc097_b
# 15:36-15:48 give up => hint
# 15:53-16:16　RE(recursion overflow)
# 16:16-16:43 done


def main():
    N, M = map(int, input().split())
    p = list(map(int, input().split()))
    p = [num-1 for num in p]
    x, y = [None] * M, [None] * M
    for i in range(M):
        x[i], y[i] = map(int, input().split())
        x[i] -= 1  # 0-index
        y[i] -= 1  # 0-index

    edges = {node: [] for node in range(N)}
    for xi, yi in zip(x, y):
        edges[xi].append(yi)
        edges[yi].append(xi)

    ans = 0
    check_node = [None] * N
    for start in range(N):
        if check_node[start] is not None:
            continue

        indexes = []
        numbers = []
        queue = [start]
        queue_i = 0
        while queue_i < len(queue):
            node = queue[queue_i]
            if check_node[node] is not None:
                queue_i += 1
                continue

            check_node[node] = 1
            indexes.append(node)
            numbers.append(p[node])
            
            for edge in edges[node]:
                if check_node[edge] is None:
                    queue.append(edge)
            
            queue_i += 1

        ans += len(set(indexes) & set(numbers))

    return ans


print(main())
N = int(input())
h = [int(i) for i in input().split()]
dp = [inf for _ in range(N)]
dp[0] = 0
for i in range(N-1):
    dp[i+1] = min(dp[i+1], dp[i] + abs(h[i+1]-h[i]))
    if i+2 < N:
        dp[i+2] = min(dp[i+2], dp[i] + abs(h[i+2]-h[i]))
print(dp[-1])

### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
inf = 10 ** 10
dp = [inf] * n
dp[0] = 0
for i in range(n - 1):
    temp = abs(h[i + 1] - h[i])
    dp[i + 1] = min(dp[i + 1], temp + dp[i])
    if i + 2 < n:
        temp = abs(h[i + 2] - h[i])
        dp[i + 2] = min(dp[i + 2], temp + dp[i])
print(dp[-1])
a,b,k=map(int,input().split())
l=range(a,b+1)
ans=sorted(list(set(l[:k]+l[-k:])))
for i in ans:
print(i)

### FIXED CODE ###

a,b,k = map(int,input().split())
r = range(a,b+1)
for i in sorted (set(r[:k])|set(r[-k:])):
    print(i)
import math
 
a, b = map(int, input().split())
a = int(a)
b_int = int(b)
b_fric = b -b_int
r1 = a*b_int
r2 = a*b_fric//100
result = r1+r2
print(result)

### FIXED CODE ###

def main():
    A, B = input().split()
    A = int(A)
    B_big, B_small = B.split(".")
    B_big = int(B_big)
    B_small = int(B_small)
    print(A*B_big + A*B_small//100)
 
 
if __name__ == "__main__":
    main()
n = int(input())
x = 1
while x <= 30:
    if(x%3==0 or x%10==3):
        print(' ',end=str(x))
    x += 1



### FIXED CODE ###

n = int(input())
y = 1

while y <= n :
    if(y % 3 == 0):
        print(' %d'%y,end='')
    else:
        p = y
        while(p != 0):
            if(p % 10 == 3):
                print(' %d'%y,end='')
                break
            p //= 10
    y+=1
print()
from collections import deque
N = int(input())


# 最大公約数
def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a


# 最小公倍数
def lcm(a, b):
    return a*b/gcd(a, b)


array = deque()
for _ in range(N):
    array.append(int(input()))

if len(array) == 1:
    print(array[0])

while len(array) > 1:
    a = array.pop()
    b = array.pop()
    array.append(lcm(a, b))

print(int(array[0]))


### FIXED CODE ###

from collections import deque
N = int(input())


# 最大公約数
def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a


# 最小公倍数
def lcm(a, b):
    return a*b//gcd(a, b)


array = []
for _ in range(N):
    array.append(int(input()))

ans = array[0]
for x in array[1:]:
    ans = lcm(ans, x)


print(ans)
a

### FIXED CODE ###

def main():
    N, A, B = map(int, input().split())
    X = list(map(int, input().split()))
 
    cost = 0
    for i in range(N-1):
        distance = abs(X[i] - X[i+1])
        if distance * A < B:
            cost += distance * A
        else:
            cost += B
    print(cost)
 
if __name__ == "__main__":
    main()
import math
*S, C = map(int, input().split())
print(["NO", "YES"][C % math.gcd(*S) == 0])

### FIXED CODE ###

A, B, C = map(int, input().split())
r = [(A * k) % B for k in range(B)]
print(["NO", "YES"][C in r])
from sys import stdin

x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    #print(i,n)
    if n > (10**10):
        break
    fivelist.append(n)
    i+=1

for i in range(len(fivelist)):
    for j in range(len(fivelist)):
        if x == (fivelist[i] - fivelist[j]):
            a, b = i , j
            break
        if x == (-fivelist[i] - fivelist[j]):
            a, b = -i , j
            break
        if x == (fivelist[i] + fivelist[j]):
            a, b = i , -j
            break
        if x == -(fivelist[i] + fivelist[j]):
            a, b = -i , -j
            break

print("{} {}".format(a,b))


### FIXED CODE ###

from sys import stdin
import random

#a , b = 81,79
#x = a**5 - b**5
'''
while x < 1 or x > 10**9:
    a = random.randint(-100, 100)
    b = random.randint(-100, 100)
    x = a**5 - b**5
'''
#print(a,b,x)
x = int(stdin.readline().rstrip())

fivelist = []

i = 0
while True:
    n = i**5
    # print(i,n)
    if n > 2*(10**15):
        break
    fivelist.append(n)
    i += 1


a = 0
b = 0
ans = False
for i in range(len(fivelist)):
    for j in range(len(fivelist)):
        if x == (fivelist[i] - fivelist[j]):
            a, b = i, j
            ans = True
            break
        if x == (-fivelist[i] - fivelist[j]):
            a, b = -i, j
            ans = True
            break
        if x == (fivelist[i] + fivelist[j]):
            a, b = i, -j
            ans = True
            break
        if x == (-fivelist[i] + fivelist[j]):
            a, b = -i, -j
            ans = True
            break
    if ans:
        break

print("{} {}".format(a, b))