Harryxun/stf_run huggingface dataset:
import numpy as np

n = int(input())
As = list(map(int, input().split()))

prime = [2]
for i in range(3, 999, 2):
  for j in range(len(prime)):
    if i % prime[j] == 0:
      break
    elif prime[j] > pow(i, 1/2):
      prime.append(i)
      break
    
mat = np.zeros((n, len(prime)))

for i in range(len(As)):
  a = As[i]
  for j in range(len(prime)):
    while True:
      if a % prime[j] == 0:
        mat[i,j] += 1
        a /= prime[j]
      else:
        break
    if a == 1:
      break

LCM = 1
max_exp = mat.max(axis=0)
for j in range(len(prime)):
  LCM *= prime[j]**max_exp[j]

B_total = 0
for i in range(len(As)):
  B_total += LCM / As[i]

print(int(B_total % (pow(10,9)+7)))

### FIXED CODE ###

from fractions import gcd

def lcm(c,d):
    return c//gcd(c,d)*d
mod=10**9+7

n=int(input())
a=[int(i) for i in input().split()]
l=a[0]
for i in range(1,n):
    l=lcm(l,a[i])
ans=0
for i in range(n):
    ans+=l//a[i]
    #ans%=mod
print(ans%mod)
import fractions

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

lcm = N*M // fractions.gcd(N, M)
ans = lcm

X = [""] * (lcm+10)

for i in range(N):
    X[i*lcm//N] = S[i]

for i in range(M):

    if X[i*lcm//M] != "":
        if X[i*lcm//M] != T[i]:
            ans = -1
            break
    
print(ans)

### FIXED CODE ###

import fractions

N, M = map(int, input().split())
S = input()
T = input()
gcd = fractions.gcd(N, M)
lcm = N*M // gcd
ans = lcm


for i in range(gcd):
    if S[i*N//gcd] != T[i*M//gcd]:
        ans = -1
        break 
    
print(ans)
n=int(input())
a=[]
for i in range(n):
  x=int(input())
  if x not in a:a.append(x)
  else:a.remove(x)
print(len(a))​

### FIXED CODE ###

n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
x=a[0]
c=1
ct=0
for i in range(1,n):
  if a[i]==x:
    c+=1
    if i==n-1:
      if c%2==1:
        ct+=1
  else:
    if c%2==1:
      ct+=1
    x=a[i]
    c=1
    if i==n-1:
      ct+=1
print(ct)
n=int(input())
l=list(map(int,input().split()))
def gcd(n,m):
  l0=[]
  if n==0:
    return m
  elif m==0;
  return n
  else:
    for i in range(1,n//2):
      if n%i==0:
        l0.append(i)
    l0.append(n)
    g=1
    for i in l0:
      if m%i==0:
        g=i
    return(g)
l1=[]
for i in range(n):
  ll1=gcd(0,l[0])
  ll2=gcd(0,l[n-1])
  if i==0:
    ll1=gcd(0,l[1])
    for j in range(1,n-1):
      ll1=gcd(ll1,l[j])
    l1.append(ll1)
  elif i==n-1:
    ll2=gcd(0,l[0])
    for j in range(n-1):
      ll2=gcd(ll2,l[j])
    l1.append(ll2)
  else:
      for j in range(i):
        ll1=gcd(ll1,l[j])
      for j in range(n-1,i:-1):
        ll2=gcd(ll2,l[j])
      l1.append(gcd(ll2,ll1))
print(max(l1))


### FIXED CODE ###

def gcd(n,m):
  a=max(n,m)
  b=min(n,m)
  while b!=0:
    a,b=b,a%b
  return a
n=int(input())
l=list(map(int,input().split()))
l1=[]
l1.append(l[0])
for i in range(1,n):
  l1.append(gcd(l1[-1],l[i]))
l2=[]
l2.append(l[-1])
for i in range(n-2,-1,-1):
  l2.append(gcd(l2[-1],l[i]))
l3=[]
for i in range(2,n):
  l3.append(gcd(l1[i-2],l2[n-i-1]))
l3.append(l2[n-2])
l3.append(l1[n-2])
print(max(l3))
A, B = map(int, input().split())

down_a = A / 0.08
up_a = (A+1) / 0.08
down_b = B / 0.1
up_b = (B+1) / 0.1

a = [i for i in range(down_a, up_a)]
b = [j for j in range(down_b, up_b)]

ans = -1
for num in a:
  if num in b:
    ans = num
    break;
print(ans)

### FIXED CODE ###

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

down_a = math.ceil(A / 0.08)
up_a = math.ceil((A+1) / 0.08)
down_b = int(B / 0.1)
up_b = int((B+1) / 0.1)

a = [i for i in range(down_a, up_a)]
b = [j for j in range(down_b, up_b)]

ans = -1
for num in a:
  if num in b:
    ans = num
    break;
print(ans)
s = input()
cnt = 0
res = []
for a in s:
    if a in ["A", "G", "C", "T"]:
        cnt += 1
    else:
        res.append(cnt)
        cnt = 0
print(max(res))

### FIXED CODE ###

s = input()
cnt = 0
r = []
r.append(0)
for ss in s:
    if ss in ["A", "C", "T", "G"]:
        cnt += 1
    else:
        r.append(cnt)
        cnt = 0
    r.append(cnt)
print(max(r))
n=int(input())
s=list(map(input().split()))

if len(s) == 4:
  print("Four")
else:
  print("Three")

### FIXED CODE ###

n=int(input())
s=list(map(str,input().split()))

if s.count("Y") >= 1:
  print("Four")
else:
  print("Three")
n,m = map(int,input().split())
s = input()
t = input()
#greatest common divisor/least common multiple
import fractions
gcd = int(fractions.gcd(n,m))
lcm = int(n*m/gcd)
counter=0
for i in range(gcd):
    if s[int(n/gcd)*i+1]!=t[int(m/gcd)*i+1]:
        print(-1)
        counter+=1
        exit()
if counter == 0:
    print(lcm)

### FIXED CODE ###

n,m = map(int,input().split())
s = input()
t = input()
#greatest common divisor/least common multiple
import fractions
gcd = int(fractions.gcd(n,m))
lcm = int(n*m/gcd)
counter=0
for i in range(gcd):
    if s[int(n/gcd)*i]!=t[int(m/gcd)*i]:
        print(-1)
        counter+=1
        exit()
if counter == 0:
    print(lcm)
import sys
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[0]>h[1] and h[0]>h[2] and h[0]>h[3]:
        x=0
        print(1)
        sys.exit()
    if h[i]>=h[i-1]:
        x=x+1 
print(x)

### FIXED CODE ###

n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[i]>=ans:
        x=x+1 
        ans=h[i]
print(x)
a,b=int(input())
if a>10:
    print('b')
else
    print(b-(100＊(10-b))
          
 

### FIXED CODE ###

a,b=map(int,input().split())
if a>9:
  print(b)
else:
  print(b+(100*(10-a)))
# -*- coding:utf-8 -*-


H, W = list(raw_input())

for i in range(H):
    for j in range(W):
        row = list(raw_input())
        print(row)
        print(row)


### FIXED CODE ###

# -*- coding:utf-8 -*-


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

for i in range(H):
    row = input()
    print(row)
    print(row)
n,m=list(map(int,input().split(" ")))
list_x=list(map(int,input().split(" ")))

list_x.sort()
list_d=[]

if m<=n:
    print(0)
else:
    i=0
    while i<=m-2:
        list_d.append(list_x[i+1]-list_x[i])
        i+=1
    list_d.sort()
    print(sum(list_d[0:m-n:1]))

### FIXED CODE ###

t,x=list(map(int,input().split(" ")))
print(t/x)
K = int(input())
count = 0
money = 100

while money < X:
  money *= 1.01
  count += 1

print(count)


### FIXED CODE ###

X = int(input())
count = 0
money = 100

while True:
  money = int(money * 1.01)
  count += 1
  if money >= X:
    print(count)
    break
N, K = map(int, input().split())
h = list(map(int, input().split()))
count = 0
for i in range(len(h)):
    a = h[i]
    if h >= K:
        count += 1
print(count)

### FIXED CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
count = 0
for i in h:
    if i >= K:
      count+=1
print(count)
A, B, C = map(int, input().split())
if A + B + C == 17:
  if A == 5:
    if B + C == 12:
      print(YES)
    else:
      print(NO)
  if A == 7:
    if B + C == 10:
      print(YES)
    else:
      print(NO)
  else:
    print(NO)
else:
  print(NO)

### FIXED CODE ###

A, B, C = map(int, input().split())
if A + B + C == 17:
  if A == 5:
    if B + C == 12:
      print("YES")
    else:
      print("NO")
  elif A == 7:
    if B + C == 10:
      print("YES")
    else:
      print("NO")
  else:
    print("NO")
else:
  print("NO")
n = input()
x = 800 * n
y = n / 15 * 200

print(x - y)

### FIXED CODE ###

n = int(input())
x = 800 * n
y = n / 15 * 200

print(x - y)
N = int(input())
s = N + 1
for i in range(N):
    if N % i == 0:
        a = i + (N/i)
        if s > a:
            s = a
print(a-2)
    

### FIXED CODE ###

N = int(input())
import math
n = math.floor(N**0.5)
s = N + 1
for i in range(1,n + 1):
    if N % i == 0:
        a = i + (N/i)
        s = a
print(int(s-2))
import numpy as np
N = int(input()) 
ai = np.arange(1,(n+1))
result = 0
for i in ai:
    if i % 3 == 0 or i % 5 == 0:
      result += i
print(result)

### FIXED CODE ###

N = input()
if N[-1] == str(7):
    print('Yes')
elif N[-2] == str(7):
    print('Yes')
elif N[-3] == str(7):
    print('Yes')    
else:
    print('No')
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,k = readInts()
    A = readInts()
    root = []
    ok = True
    l = 0
    while True:
        if ok:
            a = 1
            ok = False
        else:
            a = root[-1]
        if not A[a-1] in root:
            root.append(A[a-1])
        else:
            j = 0
            for i in range(len(root)):
                if A[a-1] == root[i]:
                    j = i
                    break
            root = root[j:]
            l = j
            #print(root)
            break

    #print(root)
    print(root[k%len(root) - (l+1)])
if __name__ == '__main__':
  main()


### FIXED CODE ###

from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,k = readInts()
    A = readInts()
    root = []
    ok = True
    l = 0
    start = [1]
    dic = defaultdict(int)
    while True:
        if ok:
            a = 1
            ok = False
        else:
            a = root[-1]
        if not dic[A[a-1]]:
            dic[A[a-1]] = a
            root.append(A[a-1])
        else:
            j = 0
            for i in range(len(root)):
                if A[a-1] == root[i]:
                    j = i
                    break
                start.append(root[i])
            root = root[j:]
            l = j
            break
    if k < len(start):
        print(start[k])
    else:
        k = k - (l+1) if k - (l+1) >= 0 else k
        print(root[k%len(root)])
if __name__ == '__main__':
  main()
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

from math import ceil
N, K = mapint()
S = list(str(input()))

old = S[0]
lis = []
cnt = 1
for i in range(1, N):
    s = S[i]
    if s!=old:
        lis.append(cnt)
        old = s
        cnt = 1
    else:
        cnt += 1
lis.append(cnt)
for l in range(K):
    if len(lis)>=3:
        l1 = lis.pop()
        l2 = lis.pop()
        lis[-1] += (l1+l2)
    else:
        l1 = lis.pop()
        lis[-1] += l1
        break

ans = sum([i-1 for i in lis])
print(ans)

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

from math import ceil
N, K = mapint()
S = list(str(input()))

old = S[0]
lis = []
cnt = 1
for i in range(1, N):
    s = S[i]
    if s!=old:
        lis.append(cnt)
        old = s
        cnt = 1
    else:
        cnt += 1
lis.append(cnt)
for l in range(K):
    if len(lis)>=3:
        l1 = lis.pop()
        l2 = lis.pop()
        lis[-1] += (l1+l2)
    elif len(lis)>=2:
        l1 = lis.pop()
        lis[-1] += l1
        break
    else:
        break

ans = sum([i-1 for i in lis])
print(ans)
# ABC098 B - Cut and Count
n = int(input())
s = input()

ans = 101
s1 = set()
l = []

for i in range(0,n):
    start = s[0:i]
    end = s[i+1:n]
    for ss in start:
        if ss in end:
            s1.add(ss)
            l.append(len(s1))
    s1.clear()
print(max(l))

### FIXED CODE ###

# ABC098 B - Cut and Count
n = int(input())
s = input()

ans=0
for i in range(n-1):
    start = s[0:i+1]
    end = s[i+1:]
    start = ''.join(set(start))
    c = 0
    for j in range(len(start)):
        if start[j] in end:
            c += 1
            ans = max(ans,c)
print(ans)
n, m = map(int, input().split())
abc = [list(map(int, input().split())) for x in range(m)]
nodes = [[] for x in range(n + 1)]

for a, b, c in abc:
    nodes[a].append([a, b, -c])

costs = [None for x in range(n + 1)]
costs[1] = 0
flg = True
for i in range(n):
    for node in nodes[1:]:
        for a, b, c in node:
            if costs[b] == None or costs[b] > costs[a] + c:
                flg = False
                costs[b] = costs[a] + c
            else:
                costs[b] = costs[b]
    if flg:
        print(-costs[n])
        break
    flg = True
else:
    print("inf")



### FIXED CODE ###

n, m = map(int, input().split())
abc = [list(map(int, input().split())) for x in range(m)]
nodes = [[] for x in range(n + 1)]

for a, b, c in abc:
    nodes[a].append([a, b, -c])

costs = [None for x in range(n + 1)]
costs[1] = 0
flg = True
for i in range(n):
    for a, b, c in abc:
        if costs[a] == None:
            continue
        if costs[b] == None or costs[b] < costs[a] + c:
            flg = False
            costs[b] = costs[a] + c
    # for node in nodes[1:]:
    #     for a, b, c in node:
    #         if costs[a] == None:
    #             continue
    #         if costs[b] == None or costs[b] > costs[a] + c:
    #             flg = False
    #             costs[b] = costs[a] + c
#     if flg:
#         print(costs[n])
#         break
#     flg = True
# else:
#     print("inf")

ans = costs[n]
negative = [False for x in range(n + 1)]
for i in range(n - 1):
    for a, b, c in abc:
        if costs[a] == None:
            continue
        if costs[b] == None or costs[b] < costs[a] + c:
            costs[b] = costs[a] + c
            negative[b] = True

        if negative[a] == True:
            negative[b] = True

print(negative[n] and "inf" or ans)
D,G=map(int,raw_input().split())
G=G/100

P=[map(int,raw_input().split()) for i in range(D)]

S=6000

dp=[ [ float("inf") for i in range(S)]  for j in range(D) ] 
a=P[0][0]
b=P[0][1]/100

for i in range(a+1):
	if i==a: dp[0][i+b]=i
	else: dp[0][i]=i

for j in range(D): dp[j][0]=0


for i in range(1,D):
	a=P[i][0]
	b=P[i][1]/100


	for s in range(S):
		for k in range(1,a):
			if s-(k*(i+1)) >=0:
				dp[i][s]=min( dp[i-1][s-(k*(i+1))]+k, dp[i-1][s] )
		if s-( a*(i+1)+b )>=0:
			dp[i][s]=min( dp[i-1][s-( a*(i+1)+b ) ]+a, dp[i-1][s] )

#print dp	
print dp[D-1][G]




### FIXED CODE ###

D,G=map(int,raw_input().split())

A=[map(int,raw_input().split()) for i in range(D)]

N=1000
dp=[ [ float("-inf") for i in range(N+100)]  for j in range(D) ] 

p=A[0][0]
c=A[0][1]


for i in range(1,p+1):
	if i==p: dp[0][i]=i*100+c
	else: dp[0][i]=i*100

for i in range(D):
	dp[i][0]=0



for k in range(1,D):
	p=A[k][0]    # number of problems per line
	c=A[k][1]    # bonus

	for i in range(N):		         #dp[k][i]
		for j in range(1,p+1):    #number of problems per line
			dp[k][i+j]=max( dp[k][i+j], dp[k-1][i]+j*(k+1)*100, dp[k-1][i+j] )
		dp[k][i+j]=max( dp[k][i+j], dp[k-1][i]+j*(k+1)*100+c,dp[k-1][i+j] )



for idx,i in enumerate(dp[D-1]):
	if i>=G:
		print idx
		quit()
while 1:
        num=map(int,raw_input().split())
        if num==[0,0,0] : break
        hrz=[0 for i in range(num[1])]
        for i in range(num[1]):
                hrz[i]=map(int,raw_input().split())
        lct=[1001,num[2]]
        while lct[0]!=1:
                pps=[0,0]
                for i in range(num[1]):
                        if pps[0]<hrz[i][0]<lct[0]:
                                if hrz[i][1]==lct[1]:
                                        pps=[hrz[i][0],hrz[i][2]]
                                elif hrz[i][2]==lct[1]:
                                        pps=[hrz[i][0],hrz[i][1]]
                lct=pps
        print lct[1]

### FIXED CODE ###

while 1:
        num=map(int,raw_input().split())
        if num==[0,0,0] : break
        hrz=[0 for i in range(num[1])]
        for i in range(num[1]):
                hrz[i]=map(int,raw_input().split())
        pps=[1001,num[2]]
        while pps!=[0,0]:
                lct,pps=pps,[0,0]
                for i in range(num[1]):
                        if pps[0]<hrz[i][0]<lct[0]:
                                if hrz[i][1]==lct[1]:
                                        pps=[hrz[i][0],hrz[i][2]]
                                elif hrz[i][2]==lct[1]:
                                        pps=[hrz[i][0],hrz[i][1]]
        print lct[1]
S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []

for i in range(N):
  kai.append(S[i])

for i in range(1, ((N - 1) / 2 + 1)):
  kai2.append(S[i])

for i in range(((N + 3) / 2), N + 1):
  kai3.append(S[i])

rev = kai.reverse
rev2 = kai2.reverse
rev3 = kai3.reverse

if kai == rev:
  if kai2 = rev2:
    if kai3 = rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

### FIXED CODE ###

S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []
rev = []
rev2 = []
rev3 = []

for i in range(N):
  kai.append(S[i])

for i in range(0, int((N - 1) / 2)):
  kai2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  kai3.append(S[i])

kai.reverse()
kai2.reverse()
kai3.reverse()

for i in range(N):
  rev.append(S[i])

for i in range(0, int((N - 1) / 2)):
  rev2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  rev3.append(S[i])

if kai == rev:
  if kai2 == rev2:
    if kai3 == rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')
a,b=map(int,input().split())
if a==b:print("H")
else:print("D")   

### FIXED CODE ###

a,b=map(str,input().split())
if a==b:print("H")
else:print("D")
X=input().split()
N=int(X[0])
M=int(X[1])
A=list(map(int,input().split()))
y=N-sum(A)
if y>=0:
  return y
return -1

### FIXED CODE ###

X=input().split()
N=int(X[0])
M=int(X[1])
A=list(map(int,input().split()))
y=N-sum(A)
z=0
if y>=0:
  z=y
else:
  z=-1
print(z)
A, B = [int(x) for x in input().split()]

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

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

def sieve(n):
    prime = []
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False

    for i in range(2, n+1):
        if is_prime[i]:
            prime.append(i)
            for j in range(2*i, n+1, i):
                is_prime[j] = False
    return prime


A_div = make_divisors(A)
B_div = make_divisors(B)

cd = sorted([a for a in A_div if a in B_div])
prime = sieve(max(cd))

#print(cd)
#print(max(cd))
#print(prime)

ans = 1 # 1は絶対入る
for a in cd:
    if a in prime:
        ans += 1

print(ans)


### FIXED CODE ###

A, B = [int(x) for x in input().split()]

def common_divisors(a, b):
    cd = []
    n = min(a, b)
    m = max(a, b)
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            if m % i == 0:
                cd.append(i)
            if i != n // i and m % (n//i) == 0:
                cd.append(n//i)
    return cd

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

def sieve(n):
    prime = []
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False

    for i in range(2, n+1):
        if is_prime[i]:
            prime.append(i)
            for j in range(2*i, n+1, i):
                is_prime[j] = False
    return prime


cd = common_divisors(A, B)
#prime = sieve(max(cd))

def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if i*i > n:
            break
        if n % i == 0:
            return False
    return True

#print(cd)
#print(max(cd))
#print(prime)

ans = 1 # 1は絶対入る
for a in cd:
    if is_prime(a):
        ans += 1

print(ans)
N = str(int(input()))
total = 0
l = len(N)-1

for i in range(2**l):
    b = format(i, '0'+str(l)+'b')
    subtotal = 0
    s = N[0]

    for j in range(len(b)):
        if int(b[j]):
            subtotal += int(s)
            s = N[j+1]
        else:
            s += N[j+1]

    subtotal += int(s)
    total += subtotal

print(total)

### FIXED CODE ###

N = str(int(input()))
total = 0
l = len(N)-1
if l == 0:
    print(N)
else:
    for i in range(2**l):
        b = format(i, '0'+str(l)+'b')
        subtotal = 0
        s = N[0]
        for j in range(len(b)):
            if int(b[j]):
                subtotal += int(s)
                s = N[j+1]
            else:
                s += N[j+1]

        subtotal += int(s)
        total += subtotal

    print(total)
n = int(input())
c = 0
d = 0
for i in range(n):
  for j in range(1,n,2):
    if j % i == 0:
      c += 1
      if c == 8:
        d += 1
print(d)
        
      
      

### FIXED CODE ###

n = int(input())
ans = 0
def cou(n):
  d = 0
  for i in range(1,n+1):
    if n % i == 0:
      d += 1
  return(d)
for j in range(1,n+1,2):
  if cou(j) == 8:
    ans += 1
print(ans)
n=int(input())
a=list(map(int,input().split()))
a.sort()
print(a[n-1]a[0])

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
print(a[n-1]-a[0])
import sys
from collections import defaultdict


def dfs(tree, p, cnt, visited):
    visited[p] = True
    for c in tree[p]:
        if visited[c]:
            continue
        cnt[c] += cnt[p]
        dfs(tree, c, cnt, visited)


def main():
    input = sys.stdin.buffer.readline
    n, q = map(int, input().split())
    tree = defaultdict(list)
    for _ in range(n - 1):
        a, b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)

    cnt = [0] * (n + 1)

    for _ in range(q):
        p, x = map(int, input().split())
        cnt[p] += x
    visited = [False] * (n + 1)
    dfs(tree, 1, cnt, visited)
    print(*cnt[1:])


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import defaultdict


def dfs(tree, p, cnt, visited):
    visited[p] = True
    cnt_here = cnt[p]
    for c in tree.get(p):
        if visited[c]:
            continue
        cnt[c] += cnt_here
        dfs(tree, c, cnt, visited)


def main():
    input = sys.stdin.buffer.readline
    sys.setrecursionlimit(10 ** 9)
    n, q = map(int, input().split())
    tree = defaultdict(list)
    for _ in range(n - 1):
        a, b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    tree = dict(tree)
    cnt = [0] * (n + 1)

    for _ in range(q):
        p, x = map(int, input().split())
        cnt[p] += x
    visited = [False] * (n + 1)
    dfs(tree, 1, cnt, visited)
    print(*cnt[1:])


if __name__ == "__main__":
    main()
n,k=map(int,input().split())


cnt=0
for item in list(map(int,input().split())):
  if item>=k:cnt+=1
print(cnt)


### FIXED CODE ###

n=int(input())

if n%2==0:
  print(0.5)
else:
  print((n//2+1)/n)
I,*U=N,*D=9**9,
P,*L='x+y,',
M,*R='x-y,',
for t in[*open(n:=0)][1:]:*z,u=t.split();exec(u+'+=[*map(int,z)],')
for*A,S in(D,R,M+P),(L,R,'y,x,'),(U,R,P+M),(L,D,P+M),(L,U,M+P),(D,U,'x,y,'):
 for x,y,r in eval('sorted((%sQ)for Q,P in enumerate(A)for x,y in P)'%S):
  if r:n,p=x,y
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')

### FIXED CODE ###

d=[[],[],[],[]]
for t in[*open(0)][1:]:*z,u=t.split();d[ord(u)%5]+=[*map(int,z)],
I=N=9**9
P,M='x+y,','x-y,'
for*A,S in(3,0,'x,y,'),(1,2,'y,x,'),(0,2,P+M),(1,3,P+M),(1,0,M+P),(3,2,M+P):
 n=p=-I
 for x,y,r in eval('sorted((%sQ)for Q,P in enumerate(A)for x,y in d[P])'%S):
  if r:n,p=x,y
  elif x==n:N=min(N,y-p)
print(N%I*5or'SAFE')
S = input()
T = input()
a = input()
if T == S + a:
  print("YES")
  else:
    print("NO")

### FIXED CODE ###


    
s = input()
t = input()

if t[:-1] == s:
    print("Yes")
else:
    print("No")
a = int(input())
b = int(input())
answer = a * b
if answer % 2 ==1:
  return 'Odd'
else:
  return 'Even'

### FIXED CODE ###

input = input().rstrip().split()
if int(input[0]) % 2 == 0 or int(input[1]) % 2 == 0:
  print('Even')
else:
  print('Odd')