peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
t=0
cnt=1
for i in range(1,N):
    if(A[i]>A[i-1]):
        if(t==0):
            t=1
        elif(t==-1):
            cnt+=1
            t=0
    if(A[i]<A[i-1]):
        if(t==0):
            t=-1
        elif(t==1):
            cnt+=1
            t=0
print(cnt)
# Judge status: Wrong Answer
X,Y = map(int, input().split())

for kame in range(1,X):
    if (2*(X-kame)+4*kame)==Y:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
n=int(input())
s=input()
ans=0
x=0
for i in range(n):
  if s[i]=='I':
    x+=1
  else:
    x-=1
  ans=max(ans,x)
print(ans)
# Judge status: Accepted
k,a,b = map(int,input().split())

if a >= b or b-a<=2:
    ans = 1+k
else:
    ans = ((k-(a-1))//2)*(b-a) + (k-(a-1))%2 +a
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
k=int(input())

ans=False
for i in range(0,k+1):
    for j in range(0,k+1):
        if(i+j>k):
            continue
        if(a*2**i<b*2**j and b*2**j < c*2**(k-i-j)):
            #print(i,j,k-i-j)
            ans=True

if(ans):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()
n = len(s)

string = '0'
ans1 = 0
for i in range(n):
	if s[i] != string:
		ans1 += 1
	if string == '0':
		string = '1'
	else:
		string = '0'

string = '1'
ans2 = 0
for i in range(n):
	if s[i] != string:
		ans2 += 1
	if string == '0':
		string = '1'
	else:
		string = '0'

print(min(ans1,ans2))
# Judge status: Accepted
L,R = map(int,input().split())
ans = float('inf')
for i in range(L,R):
  for j in range(i+1,R+1):
    if (i*j)%2019==0:
      print(0)
      exit()
    ans = min(ans,(i*j)%2019)
print(ans)
# Judge status: Wrong Answer
n=int(input())
abc=list("abcdefghijklmnopqrstuvwxyz")
D={}
for a in abc:
    D[a]=0

for i in range(n):
    s=input()
    for a in abc:
        now=D[a]
        num=s.count(a)
        if i==0:
            D[a]=num
        else:
            D[a]=min(now,num)
    #print(D)
#print(D)
ans=""
for s,v in D.items():
    ans+=s*v
if len(ans)==0:
    print("\n", end="")
else:
    print(ans)
# Judge status: Wrong Answer
N = int(input())
a = map(int, input().split())

a = sorted(a, reverse=True)

Alice = 0
Bob = 0

for i in range(N-1):
    Alice += a[i]
    Bob += a[i+1]


print(Alice-Bob)
# Judge status: Accepted
N,M = map(int,input().split())
t = [[i+1] for i in range(N)]
for i in range(M):
    A,B = map(int,input().split())
    t[A-1].append(B)
    t[B-1].append(A)
from collections import deque
d = deque()
ans = [-1]*(N)
d.append(t[0])
while len(d) > 0:
    z = d.popleft()
    x = z[0]
    for i in range(1,len(z)):
        if ans[z[i]-1] == -1:
            ans[z[i]-1] = x
            d.append(t[z[i]-1])
print("Yes")
for i in range(1,len(ans)):
    print(ans[i])
# Judge status: Wrong Answer
str1 = int(input())
str2 = input().split()

num = int(str2[1] ) - int(str2[0])
if num == 0:
    num = 1

use = int(str2[1])

ok_count = 0

for i in range(num):
    if use % str1 == 0:
        ok_count = 1
    use = use - 1

if ok_count == 1 :
    print("OK")
else:
    print("NG")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=0
t=a[0]
for x in range(n):
    c+=min(t+a[x+1],b[x])
    t=a[x+1] if t>=b[x] else max(0,t+a[x+1]-b[x])
print(c)
# Judge status: Accepted
def main():
    O = input()
    E = input()
    last = ""
    if len(O) > len(E):
        last = O[-1]
        O = O[:-1]

    ans = ""
    for s1, s2 in zip(O, E):
        ans += s1 + s2

    ans += last
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M = map(int, input().split())
ac = [False] * N
wa = [0] * N

for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S == 'AC':
        ac[p] = True
    else:
        if not ac[p]:
            wa[p] += 1

a = 0
b = 0

for i in range(N):
    if ac[i]:
        a += 1
        b += wa[i]

print(*[a, b])
# Judge status: Accepted
def main():
    import sys

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

    s = int(input())
    i = int(s**0.5)
    while i*i < s:
        i+= 1
    r = i*i-s
    ans = [0, 0, i, r, 1, i]
    print(*ans)
        
        
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s = input()
t = input()
s = sorted(s)
t = sorted(t)
#s = ''.join(sorted(s))
#t = ''.join(sorted(t))
#print(s,t)
for ss,tt in zip(s,t):
    if ss == tt:
        s.remove(ss)
        t.remove(tt)
if len(s) == len(t):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
h=int(input())
w=int(input())
n=int(input())
maxbox=max(h,w)
print(-(-n//maxbox))
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())
p_s = sorted(list(map(int, input().split())), reverse=True)[:x]
q_s = sorted(list(map(int, input().split())), reverse=True)[:y]
r_s = sorted(list(map(int, input().split())), reverse=True)

s_s = sorted(p_s + q_s)
ans = sum(s_s)
for i in range(c):
    tmp = ans - s_s[i] + r_s[i]
    if tmp <= ans:
       break
    ans = tmp

print(ans)
# Judge status: Wrong Answer
#n=int(input())
n,k=map(int,input().split())
#hl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
hl=[int(input()) for i in range(n)]

hl.sort()
ans=hl[2]-hl[0]
for i in range(n-k+1):
    ans=min(ans,hl[i+k-1]-hl[i])
print(ans)
# Judge status: Accepted
H, N = map(int, input().split())
A = list(map(int, input().split()))

if sum(A)>=H:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N, Y = map(int, input().split())
for x in range(N+1):
    for y in range(N-x+1):
        z = N-x-y
        if 0 <= z <= 2000 and 10000*x+5000*y+1000*z == Y:
            print(x, y, z)
            exit()
print(-1, -1, -1)
# Judge status: Accepted
from decimal import *
getcontext().prec = 50

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

if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
if n % 2:
    print(0)
    exit()
n = n//2
c = 0
while n:
    c += n//5
    n = n // 5
print(c)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

n, s, c = int(input()), list(map(int, input().split())), 1
for i in range(n - 1):
	if s[i] >= s[i+1]: c += 1
print(c)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
aa = abs(a)
bb = abs(b)
cc = abs(c)
dd = abs(d)
if a > 0 and c > 0:
  print(b*d)
elif b < 0 and d < 0:
  print(a*c)
elif a == 0 or b == 0 or c == 0 or d == 0:
  print(0)
elif b < 0:
  print(b*c)
else:
    print(a*d)
# Judge status: Accepted
A = [list(map(int, input().split())) for i in range(3)]
N = int(input())
b = {int(input()) for i in range(N)}

for i in range(3):
    if A[i][0] in b and A[i][1] in b and A[i][2] in b:
        print('Yes')
        exit()
    elif A[0][i] in b and A[1][i] in b and A[2][i] in b:
        print('Yes')
        exit()
if (A[0][0] in b and A[1][1] in b and A[2][2] in b) or (A[0][2] in b and A[1][1] in b and A[2][0] in b):
    print('Yes')
    exit()

print('No')
# Judge status: Wrong Answer
N = int(input())
X = [None for _ in range(N)]
for i in range(N):
  X[i] = list(map(int,input().split()))
A = [None for _ in range(N)]
B = [None for _ in range(N)]
for i in range(N):
  A[i] = X[i][0]
  B[i] = X[i][1]
  
S = sum(A)
MAX = max(B)

if S > MAX:
  print('No')
  exit()
else:
  print('Yes')
  exit()
# Judge status: Wrong Answer
N = int(input())
ans = 0

for i in range(1,N+1):
    if i % 3 == 0 or i % 5 == 0:
        ans += i

print(ans)
# Judge status: Accepted
S = list(input())
T = list(input())
flag = 0
for i in range(len(S)):
    if S == T:
        flag = 1
        break
    tmp = S.pop(0)
    S.append(tmp)
if flag == 1:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
l.sort()
m = l.pop()
a = m
ans = 0
for r in l:
  if abs((m / 2) - r) < a:
    a = abs((m / 2) - r)
    ans = r
print(m, ans)
# Judge status: Accepted
from collections import Counter

def check(s1, s2):
	for i in range(26):
		if s1[i] != s2[i]:
			return False;
	return True

n = int(input())
stuff = []
for _ in range(n):
	d = list(input())
	cnt = [0 for x in range(26)]
	for i in range(10):
		cnt[ord(d[i])-97] += 1
	stuff.append(cnt)

stuff.sort()
span = 1
ans = 0
for i in range(n-1):
	if check(stuff[i+1], stuff[i]):
		span += 1
	else:
		ans += span*(span-1)//2	
		span = 1
ans += span*(span-1)//2
print(ans)
# Judge status: Accepted
n, x, y = map(int, input().split())
lengths = [0 for i in range(n)]
for start in range(1, n+1):
    for end in range(start+1, n+1):
        lengths[min(end - start, abs(x-start) + abs(y-end) + 1)] += 1
print("\n".join(map(str, lengths[1:])))
# Judge status: Wrong Answer
import random

S = input()
ch_l = []
for i in range(0, len(S)):
  ch_l.append(S[i])
x = "".join(random.sample(ch_l, 3))
print(x)
# Judge status: Accepted
import sys
input = sys.stdin.readline
I=lambda:int(input())
MI=lambda:map(int,input().split())
LI=lambda:list(map(int,input().split()))

N=I()

if N%2:
    print(0)
else:
    res=0
    i=1
    while 1:
        dr=N//(2*5**i)
        if dr:
            res+=dr
        else:
            break
        i+=1
    print(res)
# Judge status: Accepted
N = int(input())
s = list(input())
t = list(input())
cnt = 0
if s==t:
    ans = N
    cnt = 1
elif N==1:
    ans = N*2
    cnt = 1
else:
    for i in range(N):
        if s[i:]==t[:-i]:
            cnt = 1
            ans = N*2 - (N-i)
print(ans) if cnt==1 else print(N*2)
# Judge status: Wrong Answer
a,b = map(int,input().split())
s = max(2*a,2*b,a+b)
print(s-1)
# Judge status: Wrong Answer
N,W = list(map(int,input().split()))
if N >= W:
  print("safe")
else:
  print("unsafe")
# Judge status: Accepted
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)
# Judge status: Accepted
import fractions

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

    ans = abs(x - X[0])
    for xi in X:
        ans = fractions.gcd(abs(x - xi), ans)

    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Accepted
#15 B - KEYENCE String
S = list(input())

result = 'NO'
for i in range(len(S)):
    Scpy = S.copy()
    for j in range(i,len(S)):
        Scond = Scpy[:i]+Scpy[j:]
        if (''.join(Scond)) == ('keyence'):
            result = 'YES'
            break
    else:
        continue
    break
print(result)
# Judge status: Wrong Answer
n,k,*a = map(int,open(0).read().split())
def func(b):
  c = k
  for i in a:
    if b == 0:
      c -= i
    else:
      c -= (i-1)//b
    if c < 0:
      return False
  return True
l = 0
r = max(a)
while(r>l):
  lr = (l+r)//2
  if func(lr):
    r = lr
  else:
    l = lr + 1
print(r)
# Judge status: Accepted
S = input()
l = len(S)

if 'keyence' in S:
  print('YES')
  exit()

for i in range(6):
  check = S[:i+1] + S[i+(l-7)+1:]
  if check == 'keyence':
    print('YES')
    exit()
print('NO')
exit()
# Judge status: Accepted
import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    ans = pow(10, N, MOD)
    ans -= pow(9, N, MOD)
    ans -= pow(9, N, MOD)
    ans += pow(8, N, MOD)
    print(ans%MOD)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a,b,k = map(int,input().split())
n = b - a + 1
if n <= k*2:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,k+1):
    print(i)
  for j in range(b-k+1,b+1):
     print(j)
# Judge status: Accepted
n=int(input())
a=list()
for i in range (n):
    a.append(int(input()))
new_a_reverse=sorted(a,reverse=True)
max=new_a_reverse[0]
max2=new_a_reverse[1]
for i in a:
    if(i==max):
        print(max2)
    else:
        print(max)
# Judge status: Wrong Answer
import math

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

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

swords_T = [list(x) for x in zip(*swords)]

#print(swords_T)

swing_max = max(swords_T[0])

order = sorted(swords_T[1])
#print(order)
count = 0

while H > 0 and len(order) != 0:
    tmp = order.pop()
    if tmp > swing_max:
        H -= tmp
        count += 1
#print(f'{H=}')

count += math.ceil(H/swing_max)

print(count)
# Judge status: Accepted
N,M = map(int,input().rstrip().split(" "))
A = []
B = []
ans = False
for i in range(N):
    A.append(list(input()))
for i in range(M):
    B.append(list(input()))
for i in range(N - M + 1):
    for i2 in range(N - M + 1):
        for i3 in range(M):
            if A[i3 + i][i2:i2 + M] != B[i3]:
                break
            if i3 == M -1:
                ans = True
if ans:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())

ans = 0
for a in range(1, N):
    ans += (N - 1) // a

print(ans)
# Judge status: Accepted
import copy

N = int(input())

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

ary_copy = copy.copy(ary)
ary_copy.sort()

max_1 = ary_copy[-1]
max_2 = ary_copy[-2]

for i in ary:
    if i == max_1:
        print(max_2)
    elif i != max_1:
        print(max_1)
# Judge status: Wrong Answer
N = str(input())
ans = 0
for i in N:
  ans += int(i)
if ans%9 == 0:
  print("yes")
else:
  print("no")
# Judge status: Accepted
k, s = map(int, input().split())
ans = 0
for x in range(k+1):
    for y in range(k+1):
        if 0 <= s - x - y <= k:
            ans += 1
print(ans)
# Judge status: Accepted
k, n = map(int, input().split())
a = list(map(int, input().split()))
l = len(a)
dis = [None] * l
for i in range(n - 1):
    dis[i] = a[i + 1] - a[i]
dis[-1] = a[0] - a[-1] + k

ans = sum(dis) - max(dis)
print(ans)
# Judge status: Accepted
x = int(input())
if x>=400 and x<=599:
  print(8)
elif x>=600 and x<=799:
  print(7)
elif x>=800 and x<=999:
  print(6)
elif x>=1000 and x<=1199:
  print(5)
elif x>=1200 and x<=1399:
  print(4)
elif x>=1400 and x<=1599:
  print(3)
elif x>=1600 and x<=1799:
  print(2)
elif x>=1800 and x<=1999:
  print(1)
# Judge status: Wrong Answer
S = input()
T = input()

A = ''
for i in range(len(S)):
    if S[i] == T[0]:
        A += T
        break
    A += S[i]
if A == S:
  print('UNRESTORABLE')
  exit()

ans =''  
for a in A:
  if a == '?':
    a = 'a'
  ans += a
    
print(ans)
# Judge status: Wrong Answer
a, b, c, x, y = map(int, input().split())
ans = 0


if a + b  > c * 2:
    ans += (c * 2) * min(x,y)
    if x > y:
        ans += a * (x-y)
        if ans > (c * 2) * max(x,y):
            ans = (c * 2) * max(x,y)
    elif y > x:
        ans += b * (y-x)
        if ans > (c * 2) * max(x,y):
            ans = (c * 2) * max(x,y)

elif a + b < c * 2:
    ans += (a * x) + (b * y)


print(ans)
# Judge status: Wrong Answer
ma = lambda : map(int,input().split())
ni = lambda : int(input())
import math
ceil = math.ceil
n = ni()
csf = []
for i in range(n-1):
    csf.append(tuple(ma()))
for i in range(n-1):
    ans = csf[i][1] + csf[i][0]
    for j in range(i+1,n-1):
        if ans<=csf[j][1]:
            ans =csf[j][1]+csf[j][0]
        else:
            ans = math.ceil(ans/csf[j][2]) +csf[j][0]
    print(ans)
print(0)
# Judge status: Wrong Answer
def DE(n):
    return float((float(n)+1)/2)

def main():
    N,K = map(int,input().split())
    p = list(map(DE,input().split()))
    ans = sum(p[:K])
    for i in range(K,N):
        ans = max(ans,(ans+p[i]-p[i-K]))
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

l1 = [1,3,5,7,8,10,12]
l2 = [4,6,9,11]
x,y = iim()

if (x in l1 and y in l2) or (x in l2 and y in l2):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = input()
print('Bad' if S[0] == S[1] or S[1] == S[2] or S[2] == S[3] else 'Good')
# Judge status: Accepted
n, k, *d = open(0).read().split()
n, d = int(n), set(d)
while True:
  if not d & set(str(n)):
    exit(print(n))
  n += 1
# Judge status: Accepted
N = int(input())
if N % 10 == 3:
    print('bon')
elif N % 10 == 0 or N % 10 == 1 or N % 10 == 6 or N % 10 == 8:
    print('pon')
else:
    print('hon')
# Judge status: Accepted
N = int(input())
if(N%1000 == 0):
    print(0)
else :
    print(1000 - N%1000)
# Judge status: Wrong Answer
N,X,Y = map(int,input().split())
A = [0]*(N-1)
mi = 0
for i in range(1,N+1):
  for j in range(1,N+1):
    if i < j :
      mi = min(j-i,(abs(X-i)+abs(Y-j)+1))
      A[mi-1] += 1
      print(mi)
for i in range(N-1):
  print(A[i])
# Judge status: Accepted
n = int(input())
l = [0] * 100
l[0] = 2
l[1] = 1
for i in range(2, 99):
    l[i] = l[i-1] + l[i-2]
print(l[n])
# Judge status: Accepted
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, l = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    S = [input() for i in range(n)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    #S = [list(map(str, input().split())) for i in range(n)]

    Ssort = sorted(S)
    print("".join(Ssort))
resolve()
# Judge status: Wrong Answer
N = int(input())
S = input()

if '.' not in S:
    print(0)
    exit()
elif '#' not in S:
    print(0)
    exit()

black_sum = 0
white_sum = 0
for i in range(N):
    if S[i] == '#':
        black_sum += 1
    else:
        white_sum += 1

left_black = 0
right_white = white_sum
min_sum = 10 ** 9
for i in range(N - 1):
    if S[i] == '#':
        left_black += 1
    else:
        right_white -= 1

    min_sum = min(min_sum, left_black + right_white)
print(min_sum)
# Judge status: Wrong Answer
a=input()
print('A' if a.islower else 'a')
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split())) + [0]
cnt = 0
j = False

for i in range(n):
    if p[i] == i + 1:
        cnt += 1
        if p[i + 1] == i + 2:
            if j == False:
                cnt -= 1
                j = True
            else:
                j = False
    else:
        j = False
print(cnt)
# Judge status: Accepted
s = input()
t = input()
print ("Yes") if s == t[0:len(s)] else print ("No")
# Judge status: Accepted
def modelAnswer(N:int,A:list) -> int:
   T1 = [A[0]]
   T2 = [sum(A)]
   for i in range(1,N):
      T1.append(T1[-1]+A[i])
      T2.append(T2[0] - T1[i-1])
   # print(T1,T2)
   ans = 10**10
   for i in range(len(T1)-1):
      # print(abs(T1[i]-T2[i+1]))
      ans = min(ans,abs(T1[i]-T2[i+1]))
   return ans


def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(modelAnswer(N,A[:]))
if __name__ == '__main__':
   main()
# Judge status: Accepted
from operator import itemgetter

n = int(input())
sp = [[] for _ in range(n)]
for i in range(n):
    s, p = input().split()
    p = -int(p)
    sp[i] = [s, p, i + 1]

sp.sort(key=itemgetter(0, 1))
for i in range(n):
    print(sp[i][2])
# Judge status: Wrong Answer

n = int(input())

ret = 0


for j in range(1,n+1):
    cnt = 0
    for i in range(1,j+1):
        if n % i == 0:
           cnt += 1
    if cnt == 8:
        ret += 1
print(ret)
# Judge status: Wrong Answer
N,X,Y =map(int,input().split())

def solve(k):
    global N
    global X
    global Y
    count = 0
    count = N-k
    if count<0:
        count = 0
    
    for i in range(N):
        p = i+1
        if abs(X-p)+1+N-Y>=k and abs(X-p)+1<=k:
            count += 1
        if abs(X-p)+1+(Y-p)>k and  abs(X-p)+1<=k:
            count += 1
    
        
    print(count)
    
for i in range(N-1):
    solve(i+1)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())




if  b * c >= a:
    print("yes")
else:
    print("no")
# Judge status: Wrong Answer
A, B, C = map(int, input().split())

if B >= A*C:
    print(A*C)
else:
    print(B//A)
# Judge status: Wrong Answer
a,b = map(int, input().split())
ans = int(round((a+b)/2,0))
print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
if n==1 and m==1:
    print(1)
elif n==1 and m!=1:
    print(m-2)
else:
    print((n-2)*(m-2))
# Judge status: Accepted
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

def f(a,b):
  return a*b//math.gcd(a,b)

ans = 1
n = readInt()
for j in [readInt() for i in range(n)]:
  ans = f(ans,j)

print(ans)
# Judge status: Wrong Answer
n = int(input())

s = []
for i in range(2, int(n**0.5)):
  t = 0
  while n%i == 0:
    n //= i
    t += 1
  s.append(t)
  if n == 1: break

if n > 1: s.append(1)
  
ans = 0
for i in s:
  for j in range(1, i+1):
    if i >= j:
      i -= 1
      ans += 1
    else:
      break
print(ans)
# Judge status: Wrong Answer
H = int(input())
if H==1:
  print(1)
elif 2 <= H and H <= 3:
  print(3)
elif 4 <= H and H <= 7:
  print(7)
else:
  for i in range (1,43):
    if 2**(i-1)<H and H <2**(i):
      print(2**(i)-1)
    else:
      pass
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10 ** 6)


def input():
    return sys.stdin.readline()[:-1]


N, K = map(int, input().split())
H = [0]*N
for i in range(N):
    H[i] = int(input())

H.sort()
print(H)
ans = 10**10
for i in range(N-K):
    ans = min(ans, H[i+(K-1)]-H[i])
print(ans)
# Judge status: Accepted
def resolve():
    A, B, K = list(map(int, input().split()))
    mx = min(A, B)
    ans = []
    for i in range(1, mx+1):
        if A % i == 0 and B % i == 0:
            ans.append(i)
    print(ans[-K])
    return

resolve()
# Judge status: Accepted
s = input()
t = input()

ans = "UNRESTORABLE"

for i in range(len(s)-len(t)+1):

    for j in range(len(t)):
        isRestorable = True
        if not s[j+i] == t[j] and not s[j+i] == "?":
            isRestorable = False
            break

    if isRestorable:
        ans = s[0:i] + t + s[i+len(t):len(s)]
        ans = ans.replace("?", "a")
print(ans)
# Judge status: Wrong Answer
params = input()
params = list(map(int, params.split()))
x = params[0]
y = params[1]
a = params[2]
b = params[3]
c = params[4]

p = sorted(map(int, input().split()))
q = sorted(map(int, input().split()))
r = sorted(map(int, input().split()))

def eat(l, x):
	global r
	delish = 0
	for i in range(x):
		red = 0
		if l:
			red = l[-1]
		colorless = 0
		if r:
			colorless = r[-1]
		if red > colorless:
			delish += l.pop()
		else:
			delish += r.pop()
	return delish

delish = eat(p, x)
delish += eat(q, y)
print(delish)
# Judge status: Wrong Answer
n = int(input())
s = input()
l = s.rfind(')')

cntl, cntr = 0, 0
s2 = 0
flag = 0
for i in range(l+1):
    if s[i] == '(':
        cntl += 1
    else:
        cntr += 1

if cntl <= cntr:
    s1 = '(' * (max((cntr - cntl), 0))
    print(s1, end='')
else:
    s2 = ')' * (max((cntl - cntr), 0))
    flag = 1

print(s, end='')
r1 = ')' * (max((n - l - 1), 0))
print(r1)

if flag:
    print(s2)
# Judge status: Accepted
a, b, x = (map(int, input().split()))
k = (a+b>=x) and (a<=x)
print('YES' if k else 'NO')
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]

n = 0
ans = 0
for i in range(N):
    if A[i]:
        n += A[i]
    else:
        ans += n//2
        n = 0
ans += n//2

print(ans)
# Judge status: Accepted
S = input()
Cs = [i for i, c in enumerate(S) if c == "C" and 2 <= i <= len(S) - 2]
if S[0] == "A" and len(Cs) == 1 and (S[1 : Cs[0]] + S[Cs[0] + 1 :]).islower():
    print("AC")
else:
    print("WA")
# Judge status: Accepted
n = int(input())
res=0
for i in range(n):
    if len(str(n)) % 2 != 0:
        res += 1
    n -= 1
print(res)
# Judge status: Wrong Answer
n = int(input())
s = input()
list1 = []
for counter in range (n):
  d = s.count("D",0,counter)
  i = s.count("I",0,counter)
  number = i-d
  list1.append(number)
  

if max(list1) <=0:
  print(0)
else:
  print(max(list1))
# Judge status: Wrong Answer
a,b=map(int,input().split());print([a+b,a+b-24][a+b>24])