Harryxun/stf_run huggingface dataset:
import collections

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

A = list(map(int,input().split()))
A.sort()
op = [0]*M

for i in range(M):
    b,c = map(int,input().split())
    op[i] = (c, b)

op.sort(reverse=True)

now = 0
flag = False
for i in range(M):
    if flag:
        break
    val, maisu = op[i]
    if A[now] < val:
        for j in range(maisu):
            if now+j < N:
                if A[now+j] < val:
                    A[now+j] = val
                else:
                    flag = True
                    break
        now += maisu 
    else:
        break
    
print(sum(A))

### FIXED CODE ###

import collections

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

A = list(map(int,input().split()))
A.sort()
op = [0]*M

for i in range(M):
    b,c = map(int,input().split())
    op[i] = (c, b)

op.sort(reverse=True)

now = 0
flag = False
for i in range(M):
    if flag:
        break
    val, maisu = op[i]
    if now >= N:
        break
    if A[now] < val:
        for j in range(maisu):
            if now+j < N:
                if A[now+j] < val:
                    A[now+j] = val
                else:
                    flag = True
                    break
        now += maisu 
    else:
        break
    
print(sum(A))
import itertools
N=int(input())
l=[]
for i in range(N):
  x,y,h=map(int,input().split())
  l.append([x,y,h])
s=list(itertools.product(range(0,101),repeat=2))
for A,B in itertools.combinations(range(N),2):
  if len(s)==1:
    break
  t=[]
  if l[A][2]>l[B][2]:
    for X,Y in s:
      if abs(X-l[A][0])+abs(Y-l[A][1])<abs(X-l[B][0])+abs(Y-l[B][1]):
        t.append((X,Y))
  elif l[A][2]<l[B][2]:
    for X,Y in s:
      if abs(X-l[A][0])+abs(Y-l[A][1])>abs(X-l[B][0])+abs(Y-l[B][1]):
        t.append((X,Y))
  elif l[A][2]!=0:
    for X,Y in s:
      if abs(X-l[A][0])+abs(Y-l[A][1])==abs(X-l[B][0])+abs(Y-l[B][1]):
        t.append((X,Y))
  else:
    t=[:]
  s=t[:]
a,b=s[0][0],s[0][1]
h=abs(a-l[0][0])+abs(b-l[0][1])+l[0][2]
print(a,b,h)

### FIXED CODE ###

import itertools
N=int(input())
l=[]
#l:調査情報のリスト
for i in range(N):
  x,y,h=map(int,input().split())
  l.append([x,y,h])
M=max(item[2] for item in l)#高さの最大値(暫定)
s=list(itertools.product(range(0,101),repeat=2))
#s:中心座標の候補リスト
for A,B in itertools.combinations(range(N),2):
  #調査情報の全ての2つ組を用いて絞り込む
  if len(s)==1:
    break
  t=[]
  #t:新たな中心座標の候補リスト
  if l[A][2]<l[B][2]:
    A,B=B,A
  if l[A][2]>l[B][2]:
    #2地点の高さが異なる場合
    if l[B][2]==0:
      #B地点の高さが0ならB地点は中心から[Aの高さ]以上離れている
      gap=l[A][2]-l[B][2]
      for X,Y in s:
        if abs(X-l[A][0])+abs(Y-l[A][1])+gap<=abs(X-l[B][0])+abs(Y-l[B][1]):
          t.append((X,Y))
    else:
      #B地点の高さが0でなければA地点は中心から[Aの高さ-Bの高さ]だけ離れている
      gap=l[A][2]-l[B][2]
      for X,Y in s:
        if abs(X-l[A][0])+abs(Y-l[A][1])+gap==abs(X-l[B][0])+abs(Y-l[B][1]):
          t.append((X,Y))
  
  elif l[A][2]!=0:
    #2地点の高さが等しく0ではない場合
    #2地点からM-[Aの高さ]以上離れた地点のみ残す
    for X,Y in s:
      MM=max(1,M-l[A][2])
      if abs(X-l[A][0])+abs(Y-l[A][1])==abs(X-l[B][0])+abs(Y-l[B][1]) and abs(X-l[A][0])+abs(Y-l[A][1])>=MM and abs(X-l[B][0])+abs(Y-l[B][1])>=MM:
        t.append((X,Y))
  else:
    #2地点の高さが等しく0の場合
    #2地点からM以上離れた地点のみ残す
    for X,Y in s:
      if abs(X-l[A][0])+abs(Y-l[A][1])>=M and abs(X-l[B][0])+abs(Y-l[B][1])>=M:
        t.append((X,Y))
  s=t[:]
#sの要素は唯一だと思いたい
a,b=s[0][0],s[0][1]
i=0
while l[i][2]==0:
  i+=1

h=abs(a-l[i][0])+abs(b-l[i][1])+l[i][2]
print(a,b,h)
def solve(i, m, A):
  if m == 0:
    return 1
  if i >= n:
    return 0
  res = solve(i+1, m) or solve(i+1, m-A[i])
  return res


n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())
for i in range(q)
  if solve(0, m[q], A):
    print 'yes'
  else:
    print 'no'

### FIXED CODE ###

def solve(i, m):
  if dp[i][m] != -1:
    return dp[i][m]

  if m == 0:
    dp[i][m] = 1
  elif i >= n:
    dp[i][m] = 0
  elif solve(i+1, m):
    dp[i][m] = 1
  elif solve(i+1, m-A[i]):
    dp[i][m] = 1
  else:
    dp[i][m] = 0

  return dp[i][m]



n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())

dp = [[-1 for col in range(2000)] for row in range(n+1)]

for i in range(p):
  if solve(0, m[i]):
    print 'yes'
  else:
    print 'no'
H, W = ( int(i) for i in input().split() )
S = [input() for i in range(H)]

cc = 0
for ss in S:
    for st in ss:
        if st == ".":
            cc += 1

for i in range(len(S)):
    S[i] = "#" + S[i] + "#"

temp = ["#" * (W + 2)]
S = temp + S + temp

dd = [[float("inf")] * W for i in range(H)]

def DFS(a, b, d):
    dd[a-1][b-1] = d
    for x, y in [(a+1, b), (a-1, b), (a, b+1), (a, b-1)]:
        if S[x][y] == "#":
            continue
        else:
            if dd[x-1][y-1] > d + 1:
                DFS(x, y, d + 1)

DFS(1,1,0)

print(cc - dd[H-1][W-1] -1)

### FIXED CODE ###

import sys

H, W = ( int(i) for i in input().split() )
S = [input() for i in range(H)]

cc = 0
for ss in S:
    for st in ss:
        if st == ".":
            cc += 1

for i in range(len(S)):
    S[i] = "#" + S[i] + "#"

temp = ["#" * (W + 2)]
S = temp + S + temp

dd = [[float("inf")] * W for i in range(H)]

def DFS(a, b, d):
    dd[a-1][b-1] = d
    for x, y in [(a+1, b), (a-1, b), (a, b+1), (a, b-1)]:
        if S[x][y] == "#":
            continue
        else:
            if dd[x-1][y-1] > d + 1:
                DFS(x, y, d + 1)

sys.setrecursionlimit(10000)

DFS(1,1,0)
if dd[H-1][W-1] != float("inf"):
    print(cc - dd[H-1][W-1] -1)
else:
    print("-1")
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

sums = [0]*N
remainders = [0]*M

ans = 0

for i in range(N):
    if i == 0:
        sums[0] = A[i] % M
        t = sums[0]
    else:
        t = (A[i] % M + sums[i-1]) % M
        sums[i] = t
    remainders[t] += 1
    ans += remainders[t] if t == 0 else remainders[t] - 1

print(ans)


### FIXED CODE ###

import collections
n, m = map(int, input().split())
A = [int(i) for i in input().split()]

R = [0]
a = 0
for i in range(n):
    a += A[i]
    a %= m
    R.append(a)


def nc2(n):
    return n*(n-1)//2


c = collections.Counter(R)
ans = 0
for r in set(R):
    ans += nc2(c[r])
print(ans)
a,b,c=input(),input(),input()
print ["NO","YES"][b-a==c-b]

### FIXED CODE ###

a,b,c=map(int,raw_input().split())
print ["NO","YES"][b-a==c-b]
N = int(input())
S = input()
cnt = 0
for i in range(1,N):
  if S[i-1] != S[i]:
    cnt += 1

print(cnt+1)

### FIXED CODE ###

A,B = map(int,input().split())
ans = A - B*2 if A -B*2 >0 else 0
print(ans)
#ddfdfdf
#djfkdnfjdnfjfn
#sjhdjhfjdf
def stringconcant(S,T):
    d = S
    h = T
    r = d+h
    return r

S,T= input().split()
d = stringconcant(T,S)
print(d)

### FIXED CODE ###

string_1, string_2 = input("").split()
print(string_2+string_1)
import sys


def root(x):
    if parent[x] == x:
        return x
    else:
        parent[x] = root(parent[x])
        return parent[x]


def unite(x, y):
    x = root(x)
    y = root(y)
    if x != y:
        parent[x] = y
        new_size = size_list[x] + size_list[y]
        size_list[x] = new_size
        size_list[y] = new_size


if __name__ == '__main__':
    input = sys.stdin.readline
    n, m = map(int, input().split())
    input_list = [list(map(int, input().split())) for _ in range(m)]
    parent = [i for i in range(n)]
    size_list = [1] * n
    ans_list = []
    ans = int(n*(n-1)/2)
    for a, b in input_list[::-1]:
        ans_list.append(ans)
        if root(a-1) != root(b-1):
            ans -= size_list[a-1] * size_list[b-1]
        unite(a-1, b-1)
    for ans in ans_list[::-1]:
        print(ans)


### FIXED CODE ###

import sys


def root(x):
    if parent[x] < 0:
        return x
    else:
        parent[x] = root(parent[x])
        return parent[x]


def unite(x, y):
    x = root(x)
    y = root(y)
    if x == y:
        return False
    else:
        if y > x:
            x, y = y, x
        parent[x] += parent[y]
        parent[y] = x
        return True


def size(node):
    return -parent[root(node)]

if __name__ == '__main__':
    input = sys.stdin.readline
    n, m = map(int, input().split())
    input_list = [list(map(int, input().split())) for _ in range(m)]
    parent = [-1] * n
    ans_list = []
    ans = int(n*(n-1)/2)
    for a, b in input_list[::-1]:
        ans_list.append(ans)
        tmp = size(a-1) * size(b-1)
        if unite(a-1, b-1):
            ans -= tmp

    for ans in ans_list[::-1]:
        print(ans)
a, b=map(str,input().split())
if(a=='H'):
	print(b)
else:
	if(b=='H'):
		print(D)
	else:
		print(H)

### FIXED CODE ###

a, b=map(str,input().split())
if(a=="H"):
	print(b)
else:
	if(b=="H"):
		print("D")
	else:
		print("H")
n=int(input())
l=sorted(list(map(int,input().split())))
if l[0]>=0:
  c=l[0]
  l1=[]
  for i in range(1,n-1):
    l1.append([c,l[i]])
    c-=l[i]
  score=l[-1]-c
  print(score)
  for i in l1:
    print(i[0],i[1])
  print(l[-1],c)
else:
  l1=[]
  l2=[]
  l3=[]
  for i in l:
    if i<=0:
      l1.append(i)
    else:
      l2.append(i)
  c=l1[0]
  for i in range(len(l2)-1):
    l3.append([c,l2[i]])
    c-=l2[i]
  s1=l2[len(l2)-1]
  for i in range(1,len(l1)):
    l3.append([s1,l1[i]])
    s1-=l1[i]
  score=s1-c
  print(score)
  for i in l3:
    print(i[0],i[1])
  print(s1,c)

### FIXED CODE ###

n=int(input())
l=sorted(list(map(int,input().split())))
if l[0]>=0:
  c=l[0]
  l1=[]
  for i in range(1,n-1):
    l1.append([c,l[i]])
    c-=l[i]
  score=l[-1]-c
  print(score)
  for i in l1:
    print(i[0],i[1])
  print(l[-1],c)
elif l[-1]<0:
  c=l[-1]
  l1=[]
  for i in range(0,n-1):
    l1.append([c,l[i]])
    c-=l[i]
  print(c)
  for i in l1:
    print(i[0],i[1])
else:
  l1=[]
  l2=[]
  l3=[]
  for i in l:
    if i<0:
      l1.append(i)
    else:
      l2.append(i)
  c=l1[0]
  for i in range(len(l2)-1):
    l3.append([c,l2[i]])
    c-=l2[i]
  s1=l2[len(l2)-1]
  for i in range(1,len(l1)):
    l3.append([s1,l1[i]])
    s1-=l1[i]
  score=s1-c
  print(score)
  for i in l3:
    print(i[0],i[1])
  print(s1,c)
N, M = map(int,input().split())
crain = (4 * N - M) / 2
if crain.is_integer():
  if crain >= 0　and N - int(crain) > 0:
    print("Yes")
  else:
    print("No")
else:
  print("No")


### FIXED CODE ###

import sys
x,y = map(int,input().split())
for i in range(x+1):
  for j in range(x-i+1):
    if i+j == x and (i*2)+(j*4) == y:
      print("Yes")
      sys.exit()
print("No")
n , k = list(map(int, input().split()))
kaijou = []
kaijou.append(1)
kaijou.append(1)
i = 2
while(i <= n - k + 1):
    kaijou.append(i * kaijou[i - 1])
    i += 1
for i in range(1,k + 1):
    print(int((i ** (k - i)) * ( kaijou[n - k + 1] /  (kaijou[i] * kaijou[n - k + 1 - i]))) % 1000000007)

### FIXED CODE ###

import numpy as np
import math

n , k = list(map(int, input().split()))
def combi(a,b):
    return  math.factorial(a) // (math.factorial(b) * math.factorial(a-b))
i = 2
mod = 10 ** 9 + 7
for i in range(1, k + 1):
    if n - k + 1 >= i and k - 1 >= i - 1:
        print(int(combi(n - k + 1,i) * combi(k - 1, i - 1) % mod))
    else:
        print(0)
a,b,c,k=map(int, input().split())
all_list=[1]*a+[0]*b+[-1]*c
#print(all_list)
print(sum(all_list[:k]))


### FIXED CODE ###

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

if k<=a:
    print(k)
elif a<k<=(a+b):
    print(a)
else:
    print(a+(k-a-b)*(-1))
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1)
    if i % K == 0:
        print('OK')
else : 
    print('NG')

### FIXED CODE ###

K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1):
    if i % K == 0:
        print( 'OK' )
        quit()
else:
    print( 'NG' )
from collections import defaultdict
from itertools import accumulate
import bisect


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

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

s = list(accumulate([0]+a))

b = [(s[i]-i)%k for i in range(n+1)]

d = defaultdict(int)

# 初期化
for i in range(k-1):
    d[b[i]]+=1

ans = 0
for i in range(n):
    # 自分を除外し、k-1個先が存在すれば加える。
    d[b[i]]-=1
    if i+k-1<=n:
        d[b[i+k-1]]+=1
    ans += d[b[i]]

print(ans)




### FIXED CODE ###

from collections import defaultdict
from itertools import accumulate
import bisect


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

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

s = list(accumulate([0]+a))

b = [s[i]-i for i in range(n+1)]

d = defaultdict(list)

for i in range(n+1):
    d[b[i]%k].append(i)

ans = 0
for x in d.keys():
    l = d[x]
    for j in range(len(l)):
        y = l[j]
        ans += max(0,bisect.bisect_right(l,k+y-1)-j-1)

print(ans)
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**8
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())

    N,M,R = LI()
    r = _LI()
    root = [[] for _ in range(N)]
    for _ in range(M):
        a,b,c = LI()
        root[a-1].append((b-1,c))
        root[b-1].append((a-1,c))

    memo = [[0] * R for _ in range(R)]

    min_r = INF
    for x in itertools.permutations(r):
        it = 0
        s = x[0]
        for t in x[1:]:
            if memo[s][t]:
                it += memo[s][t]
            else:
                node = [INF] * N
                q = [(s,0)]
                while q:
                    u,l = q.pop()
                    node[u] = l
                    for v,m in root[u]:
                        if node[v] > l + m:
                            q.append((v,l+m))
                memo[s][t] = node[t]
                memo[t][s] = node[t]
                it += node[t]
            s = t
        min_r = min(min_r,it)
    print(min_r)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**8
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())

    N,M,R = LI()
    r = _LI()
    root = [[] for _ in range(N)]
    for _ in range(M):
        a,b,c = LI()
        root[a-1].append((b-1,c))
        root[b-1].append((a-1,c))

    memo = [[0] * N for _ in range(N)]

    min_r = INF
    for x in itertools.permutations(r):
        it = 0
        s = x[0]
        for t in x[1:]:
            if memo[s][t]:
                it += memo[s][t]
            else:
                node = [INF] * N
                q = collections.deque()
                q.append((s,0))
                node[s] = 0
                while q:
                    u,l = q.popleft()
                    for v,m in root[u]:
                        if node[v] > l + m:
                            node[v] = l + m
                            q.append((v,l+m))
                memo[s][t] = node[t]
                memo[t][s] = node[t]
                it += node[t]
            s = t
        min_r = min(min_r,it)
    print(min_r)

if __name__ == '__main__':
    main()
import math
import sys

n, x = list(map(lambda x : int(x),input().split()))

zahyo = list(map(lambda x : int(x),input().split()))

zahyo.append(x)
zahyo.sort()

min = zahyo[1] - zahyo[0]

is_odd = False
is_even = False

odds = list()

for i in range(n):
    diff = zahyo[i+1] - zahyo[i]

    if diff % 2 == 0:
        is_even == True
    else:
        is_odd = True
        odds.append(diff)

    if diff < min:
        min = zahyo[i+1] - zahyo[i]

# print(is_odd)
# print(is_even)
if len(odds) >= 1:
    for i in range(len(odds)):
        for j in range(len(odds)):
            if math.gcd(odds[i], odds[j]) == 1:
                print(1)
                sys.exit()


if is_odd == True and is_even == True:
    print(1)
else:
    print(min)


### FIXED CODE ###

import math
from functools import reduce
import fractions
import sys


def gcd(*numbers):
    return reduce(fractions.gcd,numbers)


n, x = list(map(lambda x : int(x),input().split()))

zahyo = list(map(lambda x : int(x),input().split()))

zahyo.append(x)
zahyo.sort()

min = zahyo[1] - zahyo[0]

is_odd = False
is_even = False

odds = list()

for i in range(n):
    diff = zahyo[i+1] - zahyo[i]

    if diff % 2 == 0:
        is_even == True
    else:
        is_odd = True
        odds.append(diff)

    if diff < min:
        min = zahyo[i+1] - zahyo[i]

# print(is_odd)
# print(is_even)
if is_odd == True and is_even == True:
    print(1)
    sys.exit()

elif is_odd == True:
    print(gcd(*odds))
else:

    print(min)
import sys
sys.setrecursionlimit(10 ** 5 + 10)
from numba import njit
def input(): return sys.stdin.readline().strip()

@njit
def resolve():
    
    n,k=map(int,input().split())
    A=list(map(int,input().split()))+[0]

    m=n
    log = 0
    while m >= 2:
        m = m // 2
        log += 1
    from itertools import accumulate

    for i in range(min(k,n*2*log+1)):
        B=[0]*(n+1)

        for j in range(n):
            val=A[j]
            #if val==0: continue
            B[max(0,j-val)]+=1
            B[min(n,j+val+1)]-=1
        A=list([0]+list(accumulate(B)))[1:]
    
    

    print(*A[:-1])    
    
    
resolve()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n,k=map(int,input().split())
    A=list(map(int,input().split()))

    for i in range(k):
        B=[0]*(n+1)

        for j in range(n):
            val=A[j]
            B[max(0,j-val)]+=1
            B[min(n,j+val+1)]-=1
        
        for k in range(n):
            B[k+1]+=B[k]
        A=B[:-1]

        if A==[n]*(n):
            break
    
    

    print(*A)    
    
resolve()
A = []
for i in range(5):
  str = input()
  A.append( int(str) )

min = 9
num = 0
 for i in range(len(A)):
    if min > A[i]%10 and A[i] % 10 != 0:
      min = A[i]%10
      num = i
      
ans = 0
for i in range(5):
  ans = ans + int(A[i]/10)
ans = ans + A[num] % 10

print(ans)


### FIXED CODE ###

A = []
for i in range(5):
  str = input()
  A.append( int(str) )

min = 9
num = 0
for i in range(len(A)):
    if min > A[i]%10 and A[i] % 10 != 0:
      min = A[i]%10
      num = i
      
ans = 0
for i in range(5):
  if i != num:
    ans = ans + int((A[i]+9)/10) * 10
ans = ans + A[num]

print(ans)
s = input()
p = int(s[:2])
a = int(s[2:])

if 0 < p < 13 and 0 < a < 13:
    print("AMBIGUOUS")
elif 0 < p < 13 and 0 < a < 100:
    print("MMYY")
elif 0 < p < 100 and 0 < a < 13:
    print("YYMM")
else p == 0 or a == 0 or p > 12 and a > 12:
    print("NA")

### FIXED CODE ###

s = input()
p = int(s[:2])
a = int(s[2:])

if 0 < p < 13 and 0 < a < 13:
    print("AMBIGUOUS")
elif 0 < p < 13 and 0 <= a < 100:
    print("MMYY")
elif 0 <= p < 100 and 0 < a < 13:
    print("YYMM")
else:
    print("NA")
n = int(input())

graph = [[0] * 9 for i in range(9)]

for i in range(1, n + 1):
    if i % 10 != 0:
        i = str(i)
        sentou = int(i[0])
        matubi = int(i[-1])
        graph[sentou - 1][matubi - 1] += 1

import numpy as np

graph = np.array(graph)

print(np.trace(np.dot(graph, graph)))

### FIXED CODE ###

n = int(input())

graph = [[0] * 9 for i in range(9)]

for i in range(1, n + 1):
    if i % 10 != 0:
        i = str(i)
        sentou = int(i[0])
        matubi = int(i[-1])
        graph[sentou - 1][matubi - 1] += 1

import numpy as np

graph = np.array(graph)

print(np.trace(np.dot(graph, graph)))
n=int(input())
v=list(map(int,input().split()))
vec=[]
vec.append(v[0])
for i in range(0,n-1):
  vec.append(min(v[i],v[i+1]))
vec.append(v[n-1])
sum=0
for i in range(n+1):
  sum+=vec[i]
print(sum)

### FIXED CODE ###

n=int(input())
v=list(map(int,input().split()))
vec=[]
vec.append(v[0])
for i in range(0,n-2):
  vec.append(min(v[i],v[i+1]))
vec.append(v[n-2])
sum=0
for i in range(n):
  sum+=vec[i]
print(sum)
Inp = list(map(int, input().split()))
Blist = list(map(int, input().split()))
Blist.sort()

out = 0
for i in range(Imp[0,1]):
    out += Blist[-(i+1)]
    
print(out)

### FIXED CODE ###

Imp = list(map(int, input().split()))
A = Imp[0]
B = Imp[1]
re = 0
if A % 3 == 0:    
    re = 1
if B % 3 == 0:
    re = 1
if (A+B) % 3 == 0:
        re = 1
        
if re ==1:
    print("Possible")
else:
    print("Impossible")
import numpy as np
import math

N = int(input())
T = np.array([int(input()) for _ in range(N)])

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

t_lcm = lcm(T[0],T[1])
for i in range(2,N):
    t_lcm = lcm(t_lcm,T[i])
print(t_lcm)



### FIXED CODE ###

import fractions
n=int(input())
ans=int(input())
for i in range(n-1):
  t=int(input())
  ans=(ans*t)//fractions.gcd(t,ans)
print(ans)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

H, W = map(int, input().split())

if H > W:
    H, W = W, H

if H%3 == 0 or W%3 == 0:
    print(0)
elif H%2 == 0:
    H_div = H//2
    W_div = round(W/3)
    print(abs(H_div*(W-W_div) - H*W_div))
    print(a)
else:
    H_div = round(H/3)
    W_div = W//2
    H_div2 = H//2
    W_div2 = round(W/3)
    print(min(abs(H_div*W - (H-H_div)*W_div), abs(W_div*H - (W-W_div)*H_div)))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

H, W = map(int, input().split())

if H < W:
    H, W = W, H

S = H * W
for i in range(1, H):
    A = i * W
    BH1 = ((H-i)//2) * W
    BH2 = ((H-i)//2+(H-i)%2) * W
    BW1 = (W//2) * (H-i)
    BW2 = (W//2+W%2) * (H-i)
    SH = max(A,BH1,BH2) - min(A,BH1,BH2)
    SW = max(A,BW1,BW2) - min(A,BW1,BW2)
    S = min(S, SH, SW)

for i in range(1, W):
    A = i * H
    BH1 = ((W-i)//2) * H
    BH2 = ((W-i)//2+(W-i)%2) * H
    BW1 = (H//2) * (W-i)
    BW2 = (H//2+H%2) * (W-i)
    SH = max(A,BH1,BH2) - min(A,BH1,BH2)
    SW = max(A,BW1,BW2) - min(A,BW1,BW2)
    S = min(S, SH, SW)

print(S)
P, Q, R = list(map(int, input().split()))
x = [P, Q, R]
maxvalue = 0
for i in x:
    if x[i] > maxvalue:
        maxvalue = x[i]
print(P + Q + R - maxvalue)

### FIXED CODE ###

P, Q, R = list(map(int, input().split()))
x = [P, Q, R]
maxvalue = 0
for i in range(len(x)):
    if x[i] > maxvalue:
        maxvalue = x[i]
print(P + Q + R - maxvalue)
A = input()
B = input()

if A < 9 and B < 9:
    print(Yay!)
else:
    print(":(")

### FIXED CODE ###

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

if A < 9 and B < 9:
    print("Yay!")
else:
    print(":(")
map(int,input(),split())
if a*b% == 1:
  print('Odd')
else:
  print('Even')

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2 == 1:
  print('Odd')
else:
  print('Even')
a=input().split()
#a=int(input())
#b=int(input())
#c=int(input())
#d=int(input())
if a[0]==a[1]==a[2]:
    print(1)
elif a[0]!=a[1]! and a[1]!=a[2] and a[0]!=a[2]:
    print(3)
else:
    print(2)


### FIXED CODE ###

a=input().split()

if a[0]==a[1]==a[2]:
    print(1)
elif a[0]!=a[1] and a[1]!=a[2] and a[0]!=a[2]:
    print(3)
else:
    print(2)