Harryxun/stf_run huggingface dataset:
a = []
tmp = 0
input()
a = list(map(int, input().split()))
a.sort(reverse=True)
for i in range(len(a)):
    if a[i] == a[i+3] and tmp == 0:
        print(a[i]**2)
        exit()
    elif a[i] == a[i+1]:
        if tmp == 0:
            W = a[i]
            tmp = 1
            del a[i+1]
        else:
            H = a[i]
            break
print(W*H)

### FIXED CODE ###

input()
a = list(map(int, input().split()))
a.sort(reverse=True)
i, c = 0, 0
m = list()
while i < len(a)-1:
    if a[i] == a[i+1]:
        m.append(a[i])
        i += 1
        c += 1
    i += 1
    if c == 2:
        break
if c == 2:
    print(m[0]*m[1])
else:
    print(0)
a=int(input())
inport math
b=math.ceil(a/2)
print(b/a)

### FIXED CODE ###

import math
a=int(input())
b=math.ceil(a/2)
print(b/a)
n=int(input())
dat = list(map(int, input().split()))
dan = []
for e in dat:
    e = list(str(bin(e)))
    e.reverse()

re = 0
for e in dat:
     w=e.index("1")
     re=w
     
print(re)
     

 
      
      
             


    
    
     
                

         
           




### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
a,b,c,d=map(int,input().split())
import math
import fractions
nc=math.floor((b-a)/c)
nd=math.floor((b-a)/d)
lcd=c*d//math.gcd(c,d)
ncd=math.floor((b-a)/lcd)
sum=nc+nd-ncd
print(b-a-sum)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
import fractions
import math
nc=b//c-(a-1)//c
nd=b//d-(a-1)//d
min=c*d//fractions.gcd(c,d)
ncd=b//min-(a-1)//min
print(b-a+1-(nc+nd-ncd))
import copy
import itertools

s = input()
q = int(input())
#s= list(input())

ct = 0
ls = []
rs = []
for i in range(q):
    qtmp = input().split()
    "qtmp = [2,1,'c']
    t = int(qtmp[0])
    if(t == 1):
        ct += 1
        ct = ct % 2
    else:
        f = int(qtmp[1])
        if(ct == f):
            rs.append( qtmp[2])
        else:
            ls.append( qtmp[2])
if(ct == 1):
    tmp = rs
    rs = ls
    ls = tmp
for i in range(len(ls)):
    print(ls[len(ls)-i-1], end='')
print(s, end='')
for i in range(len(rs)):
    print(rs[i], end='')
print("")

### FIXED CODE ###

import copy
import itertools

s = input()
q = int(input())
#s= list(input())

ct = 0
ls = []
rs = []
for i in range(q):
    qtmp = input().split()
    #qtmp = [2,1,'c']
    t = int(qtmp[0])
    if(t == 1):
        ct += 1
        ct = ct % 2
    else:
        f = int(qtmp[1])
        if(ct+1 == f):
            ls.append( qtmp[2])
        else:
            rs.append( qtmp[2])
if(ct == 1):
    tmp = rs
    rs = ls
    ls = tmp
    s = s[::-1]
for i in range(len(ls)):
    print(ls[len(ls)-i-1], end='')
print(s, end='')
for i in range(len(rs)):
    print(rs[i], end='')
print("")
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

diff = [0 for i in range(N)]
for i in range(N):
  diff[i] = V[i] - C[i]
diff = list(reversed(sorted(diff)))
i, ans = 0, 0
while diff[i] >= 0:
  ans += diff[i]
  i += 1
print(max(ans, 0))

### FIXED CODE ###

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i in range(N):
  if V[i] > C[i]:
    ans += V[i] - C[i]
print(ans)
N,S = input().split()
 
S1 = S[:int(N)/2]
S2 = S[int(N)/2:]
 
if S1 == S2:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
s = input()
 
m = len(s) // 2
if s[:m] == s[m:]:
    print("Yes")
else:
    print("No")
for i in range(100):
    t = i * 2019
    if t > 200000:
        break
    for i in range(len(str(s))):
        for j in range(i+1, len(str(s))+1):
            tmp = s[i:j]
            if int(tmp) == t:
                c += 1


print(c)

### FIXED CODE ###

import math
s = input()
n = len(s)
count = 0
a = [0 for i in range(2019)]
a[0] = 1
k = 0
b = [0 for i in range(n)]
b[0] = 1
for i in range(1, n):
    b[i] = b[i-1]*10 % 2019

#print(b)
for i in reversed(range(0, n)):
 #   print((b[n-i-1])*int(s[i]) % 2019)
    k += (b[n-i-1])*int(s[i]) % 2019
  #  print(k, k % 2019)
    a[k % 2019] += 1

for i in range(len(a)):
    if a[i] >= 2:
        count += (a[i])*(a[i]-1)//2
print(count)
a,b=map(int, input().split())
print(math.ceil((a+B)/2))

### FIXED CODE ###

import math
a,b=map(int, input().split())
print(math.ceil((a+b)/2))
K,A,B = map(int,input().split())
A <= B 
if A or B % K == 0:
	print("OK")
else:
  	print("NG")

### FIXED CODE ###

K=int(input())
A,B=map(int,input().split())
ans="NG"

for i in range(1001):
  if A<=i*K and i*K<=B:
    ans="OK"
    break

print(ans)
w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print((w - x) * h,end=" ")
    print(1)
elif x == 0 and y == 0:
    print(w * h / 2,end=" ")
    print(0)
elif x == 0:
    print(max(((h - y) * w) / 2,(y * w) / 2),end=" ")
    print(0)
elif y == 0:
    print(max(((w - x) * h) / 2,(x * h) / 2),end=" ")
    print(0)
elif w / x == h / y:
    print(w * h / 2,end=" ")
    print(0)
elif w / 2 == x:
    print(x * h,end=" ")
    print(0)
elif h / 2 == y:
    print(w * y,end=" ")
    print(0)
else:
    print(max(w * y,x * h,((w-x)*(h-y))/2,end=" "))
    print(0)

### FIXED CODE ###

w, h, x, y = map(int,input().split())

if w / 2 == x and h / 2 == y:
    print(w * h / 2, 1)
else:
    print(w * h / 2, 0)
n = int(input())
a = input()
b = input()
res = ''
for i in range(len(a)):
    res += a[i]
    res += b[i]
print(res)


### FIXED CODE ###

n = int(input())
a, b = input().split(' ')
res = ''
for i in range(n):
    res += a[i]
    res += b[i]
print(res)
N, K= map(int, input().split())
h=0
for i in range(N):
    a, b = map(int, input().split())
    h+=b
    if h>=K:
        print(a)
        break

### FIXED CODE ###

A,B,C= map(int, input().split())
if A<=C<=B:
    print("Yes")
else:
    print("No")
X=input()
if x in "753":
    print("YES")
else:
    print("NO")

### FIXED CODE ###

X=input()
if X in "753":
    print("YES")
else:
    print("NO")
a,b = map(int,input().split())
print(int(a*b))

### FIXED CODE ###

a,b = input().split()
a = int(a)
b,bb = b.split(".")
b = int(b)*100+int(bb)
print((a*b)//100)
n = int(input())

import math
def bank2(n):
    ans = 1
    list_six = [6**i for i in range(math.floor(math.log(n, 6)+1))]
    list_nine = [9**i for i in range(math.floor(math.log(n, 9)+1))]
    
    if n in list_six or n in list_nine:
        pass
    elif n == 12 or n == 13 or n == 14:
        ans += bank(n-6)
    elif n > 1:
        ans += min(bank(n - list_six[-1]), bank(n - list_nine[-1]))
        
    return ans

print(bank2(n))

### FIXED CODE ###

n = int(input())
import math

ans = []
for i in range(n+1):
    cnt6 = i
    cnt9 = n - i
    ans6 = 0
    ans9 = 0
    
    while cnt6 > 0:
        sho = 6**math.floor(math.log(cnt6, 6))
        ans6 += cnt6//sho
        cnt6= cnt6%sho
        
    while cnt9 > 0:
        if cnt9 != 59049:
            sho2 = 9**math.floor(math.log(cnt9, 9))
        else:
            sho2=59049
        ans9 += cnt9//sho2
        cnt9 = cnt9%sho2
        
    ans.append(ans6+ans9)
    sho, sho2 = 0, 0
        
print(min(ans))
import sys
n,k = map(int, sys.stdin.readline().split())
a = list(map(int, sys.stdin.readline().split()))
ma = []
pu = []
for i in range(n):
    if a[i] < 0:
        ma.append(a[i])
    else:
        pu.append(a[i])
for i in range(len(ma)):
    ma[i] = -ma[i]
ma.sort()
ans = float("inf")
for i in range(len(ma)):
    kota = 0
    kota += ma[i]
    if k <= i+1:
        ans = min(kota,ans)
    else:
        kota += ma[i]
        if (len(pu) >= k- i-2 and len(pu) != 0):
            kota += pu[k-i-2]
            ans = min(kota,ans)
for i in range(len(pu)):
    kota = 0
    kota += pu[i]
    if k <= i+1:
        ans = min(kota,ans)
    else:
        kota += pu[i]
        if (len(ma) >= k- i-2 and len(ma) != 0):
            kota += ma[k-i-2]
            ans = min(kota,ans)
print(ans)

### FIXED CODE ###

import sys
n,k = map(int, sys.stdin.readline().split())
a = list(map(int, sys.stdin.readline().split()))
ma = []
pu = []
for i in range(n):
    if a[i] < 0:
        ma.append(a[i])
    else:
        pu.append(a[i])
for i in range(len(ma)):
    ma[i] = -ma[i]
ma.sort()
ans = float("inf")
for i in range(len(ma)):
    kota = 0
    kota += ma[i]
    if k <= i+1:
        ans = min(kota,ans)
    else:
        kota += ma[i]
        if len(pu) >= k- i-1:
            kota += pu[k-i-2]
            ans = min(kota,ans)
for i in range(len(pu)):
    kota = 0
    kota += pu[i]
    if k <= i+1:
        ans = min(kota,ans)
    else:
        kota += pu[i]
        if len(ma) >= k- i-1:
            kota += ma[k-i-2]
            ans = min(kota,ans)
print(ans)
import math
n = int(input())
t = [int(input()) for i in range(n)]
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
l = t[0]
for x in range(n):
    l = lcm(l,t[x])
print(l)

### FIXED CODE ###

import fractions
n = int(input())
t = [int(input()) for i in range(n)]
def lcm(x, y):
    return (x * y) //fractions.gcd(x, y)
l = t[0]
for x in range(n):
    l = lcm(l,t[x])
print(l)
n=int(input())
lists=[list(input().split()) for x in range(n)]
for x in range(n):
  lists[x].append(x+1)
lists.sort(key=lambda t:t[1] reverse=True)
lists.sort(key=lambda t:t[0])
for x in range(n):
  print(lists[x][2])

### FIXED CODE ###

n=int(input())
lists=[]
for x in range(n):
  a,b=input().split()
  lists.append([a,int(b),x+1])
lists.sort(key=lambda t:t[1],reverse=True)
lists.sort(key=lambda t:t[0])
for x in range(n):
  print(lists[x][2])
s=input()
K=int(input())
p=set()
for i in range(len(s)):
  for j in range(1,6):
    if i+j<=len(s):
      p.add(s[i:j+1])
p=sorted(p)
print(p[K-1])

### FIXED CODE ###

s=input()
s=s+'0'
K=int(input())
p=set()
for i in range(len(s)):
  for j in range(1,6):
    if i+j<=len(s)-1:
      p.add(s[i:j+i])
p=sorted(p)
print(p[K-1])
a=[]
a=int(input().split())
for i in a:
 if a[i]==0:
   print(i+1)
 else:
  pass

### FIXED CODE ###

a=[]
a=input().split()
for i in range(5):
 if a[i]=='0':
   print(str(i+1))
 else:
   pass
N, M ,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ruiA, ruiB = [0], [0]

for i in range(N):
    ruiA.append(ruiA[i] + A[i])

for j in range(M):
    ruiB.append(ruiB[j] + B[j])

tmpa, tmpb = 0, 0
tmp = 0
t = False
for i in range(N + M + 1):
    if i <= N and ruiA[i] <= K:
        continue
    if i <= M and ruiB[i] <= K:
        continue
    if ruiA[N] + ruiB[i - N] <= K:
        continue
    if ruiA[i - M] + ruiB[M] <= K:
        continue

    t = False
    for j in range(0, i + 1):
        if j > M or i - j > N:
            continue
        if ruiA[i - j] + ruiB[j] <= K:
            t = True
            break

    if not t:
        print(i - 1)
        exit()

print(N + M)


### FIXED CODE ###

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

ruiA, ruiB = [0], [0]

for i in range(N):
    ruiA.append(ruiA[i] + A[i])

for j in range(M):
    ruiB.append(ruiB[j] + B[j])

t = False
for i in range(N + M + 1):
    if i <= N and ruiA[i] <= K:
        continue
    if i <= M and ruiB[i] <= K:
        continue
    if i > N and ruiA[N] + ruiB[i - N] <= K:
        continue
    if i > M and ruiA[i - M] + ruiB[M] <= K:
        continue

    t = False
    for j in range(0, i + 1):
        if j > M or i - j > N:
            continue
        if ruiA[i - j] + ruiB[j] <= K:
            t = True
            break

    if not t:
        print(i - 1)
        exit()

print(N + M)
a, b, k = input().split()
print(max(a - k, 0), b - max(k - a, 0))


### FIXED CODE ###

a, b, k = map(int, input().split())
print(max(a - k, 0), max(b - max(k - a, 0), 0))
def rec(i):
    if dp[i] < float('inf'): return dp[i]
    if i == 0: return 0
    if i == 1: 
        dp[i] = rec(i-1) + abs(h[i-1] - h[i])
    else:
        dp[i] = min(rec(i-2) + abs(h[i-2] - h[i]), rec(i-1) + abs(h[i-1] - h[i]))
    return dp[i]
    
N = int(input())
h = list(map(int, input().split()))
dp = [float('inf')]*N
print(rec(N-1))

### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
dp = [0]*N
dp[1] = abs(h[1]-h[0])
for i in range(2, N):
    dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
print(dp[-1])
N = int(input())

def make_divisors(n):
    ans = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ans += 1
            if i != n // i:
                ans += 1
    return ans

for i in range(1,N+1):
    if (i %2 ==1) and (make_divisors(i) ==8):
        ans += 1

print(ans)

### FIXED CODE ###

N = int(input())

def make_divisors(n):
    ans = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ans += 1
            if i != n // i:
                ans += 1
    return ans

ans = 0
for i in range(1,N+1):
    if (i %2 ==1) and (make_divisors(i) ==8):
        ans += 1

print(ans)
N,K = map(int, input().split())
A = [int(a) for a in input().split()]

A.sort(reverse=True)
X = A[0]
for i in range(1,N):
    X = (X^A[i])

temp = bin(X)
temp = temp[::-1]
List = []
for i in range(len(temp)-2):
    List.append(temp[i])
while X > K:
    index = List.index(1)
    List[index] = 0
    X = 0
    for j in range(len(List)):
        X += (List[j]*2**j)
        
ans = 0
for l in range(N):
    ans += (A[l]^X)

print(ans)

### FIXED CODE ###

N,K = map(int, input().split())
A = [int(a) for a in input().split()]

d = 50
L = [0]*d
for i in range(N):
    b = list(bin(A[i]))
    for j in range(2, len(b)):
        if b[j] == "1":
            L[len(b)-j-1] += 1

X0 = [0]*d
X1 = [0]*d
for i in range(d):
    X0[i] = 2**i*L[i]
    X1[i] = 2**i*(N-L[i])
    
ans = 0
    
Kb = list(bin(K))
for i in range(2, len(Kb)):
    if Kb[i] == "0":
        continue
    c = 0
    for j in range(2, len(Kb)):
        if j < i:
            if Kb[j] == "0":
                c += X0[len(Kb)-1-j]
            else:
                c += X1[len(Kb)-1-j]
        elif j == i:
            c += X0[len(Kb)-1-j]
        else:
            c += max(X0[len(Kb)-1-j], X1[len(Kb)-1-j])
    ans = max(ans, c)
    
for i in range(len(Kb)-2, d):
    ans += X0[i]
    
c = 0
for i in range(N):
    c += K^A[i]
    
ans = max(ans, c)
print(ans)
S=set(input())
print("Yes" len(S)==3 else "No")

### FIXED CODE ###

S=set(input())
print("Yes" if len(S)==3 else "No")
import sys

X, Y, A, B, C = map(int, sys.stdin.readline().strip().split())

P = list(map(int, sys.stdin.readline().strip().split()))
Q = list(map(int, sys.stdin.readline().strip().split()))
R = list(map(int, sys.stdin.readline().strip().split()))

P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

P = P[:X]
P.sort()
Q = Q[:Y]
Q.sort()

ans = 0
i, j, k = 0, 0, 0
while C > k:

    if P[i] >= Q[j]:
        if R[k] > Q[i] and Y > j:
            Q[j] = R[k]
            j += 1
            k += 1
        elif R[k] > P[i] and X > i:
            P[i] = R[k]
            i += 1
            k += 1
        else:
            break

    elif P[i] < Q[j]:
        if R[k] > P[i] and X > i:
            P[i] = R[k]
            i += 1
            k += 1
        elif R[k] > Q[i] and Y > j:
            Q[j] = R[k]
            j += 1
            k += 1
        else:
            break
        

# print(P)
# print(Q)
print(sum(P) + sum(Q))

### FIXED CODE ###

import sys

X, Y, A, B, C = map(int, sys.stdin.readline().strip().split())

P = list(map(int, sys.stdin.readline().strip().split()))
Q = list(map(int, sys.stdin.readline().strip().split()))
R = list(map(int, sys.stdin.readline().strip().split()))

P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

P = P[:X]
P.sort()
Q = Q[:Y]
Q.sort()

ans = 0
i, j, k = 0, 0, 0
while C > k:
    if X > i and Y > j:

        if P[i] >= Q[j]:
            if R[k] > Q[j] and Y > j:
                Q[j] = R[k]
                j += 1
                k += 1
            elif R[k] > P[i] and X > i:
                P[i] = R[k]
                i += 1
                k += 1
            else:
                break
 
        elif P[i] < Q[j]:
            if R[k] > P[i] and X > i:
                P[i] = R[k]
                i += 1
                k += 1
            elif R[k] > Q[j] and Y > j:
                Q[j] = R[k]
                j += 1
                k += 1
            else:
                break
    elif X > i:
        if R[k] > P[i]:
            P[i] = R[k]
            i += 1
            k += 1
        else:
            break
    elif Y > j:
        if R[k] > Q[j]:
            Q[j] = R[k]
            j += 1
            k += 1
    else:
        break

# print(P)
# print(Q)
print(sum(P) + sum(Q))
# coding: utf-8
# Your code here!
n=int(input())
a=[int(x) for x in input().split()]
import math
def prod(lists):
    ans=1
    for i in lists:
        ans=ans*i
    return ans
def gcd(numbers):
    ans=numbers[0]
    for i in numbers:
        ans=math.gcd(ans,i)
    return ans
lcm=prod(a)//gcd(a)
print(sum([(lcm-1)%ai for ai in a]))

### FIXED CODE ###

n=int(input())
a=[int(x) for x in input().split()]
print(sum([(ai-1)%ai for ai in a]))
a, b, k = map(int, input().split())

z = list(range(a, b + 1))
ans = sorted(list(set(z[:k]) | set(z[-k:])))
print(ans)


### FIXED CODE ###

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

for i in range(a, min(a + k, b - k + 1)):
    print(i)
for i in range(max(a, b - k + 1), b + 1):
    print(i)
a,b,m = list(map(int,input().split()))
a_li = list(map(int,input().split()))
b_li = list(map(int,input().split()))
cost = [min(a_li) + min(b_li)]

for i in range(m):
  x,y,c = map(int,input().split())
  price = a_li[x-1] + a_li[y-1] - c
  cost.append(price)
print(min(cost))


### FIXED CODE ###

A, B, M = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
X = [list(map(int, input().split())) for i in range(M)]

ans = [min(a) + min(b)]
for x in X:
    a_idx, b_index, c = x
    ans.append(a[a_idx - 1] + b[b_index - 1] - c)

print(min(ans))
num = int(input()).split()
if num[0] * 500 > num[1]: print("Yes")
else: print("No")

### FIXED CODE ###

num = input().split()
if int(num[0])*500 >= int(num[1]):
    print("Yes")
else: 
    print("No")
N=int(input())
if N%2=0:
    print(N/2)
else:
    print((N+1)/2)

### FIXED CODE ###

N=int(input())

if N%2==0:
    print(N//2)

else:
    print((N+1)//2)
N,M=map(int,input().split())
if M%N==0:
  print(M//N)
else:
  s=M//N
  if s<100000:
    ans=1
    while s!=1:
      if M%s==0:
        ans=s
        break
      s-=1
    print(ans)
  else:
    rM=M**(1/2)
    s=N
    ans=1
    while s<=rM:
      if M%s==0:
        ans=M//s
        break
      s+=1
    else:
      s=N
      while s!=1:
      if M%s==0:
        ans=s
        break
      s-=1
    print(ans)

### FIXED CODE ###

N,M=map(int,input().split())
if M%N==0:
  print(M//N)
else:
  s=M//N
  if s<100000:
    ans=1
    while s!=1:
      if M%s==0:
        ans=s
        break
      s-=1
    print(ans)
  else:
    rM=M**(1/2)
    s=N
    ans=1
    while s<=rM:
      if M%s==0:
        ans=M//s
        break
      s+=1
    else:
      s=N
      while s!=1:
        if M%s==0:
          ans=s
          break
        s-=1
    print(ans)
α　= input('input your favorite alpabet:')
if α.isupper():
    print('A')
elif α.islower:
    print('a')


### FIXED CODE ###

a = input()
print('A' if a.isupper() else 'a')
input()
nums = map(int, input().split())
count = 0
flg = True
while Flg:
  for i, n in enumerate(nums):
    if n % 2 == 1:
      flg = False
      break
    else:
      nums[i] = n / 2
      count += 1
print(count)
      

### FIXED CODE ###

kazu = int(input())
nums = list(map(int, input().split()))
count = 0
flg = True
while flg:
  for i in range(kazu):
    if nums[i] % 2 == 1:
      flg = False
      break
    else:
      nums[i] /= 2
  count += 1
count -= 1
print(count)
from functools import reduce
from operator import add

n = int(input())
l1 = [int(i) for i in input().split()]
print(reduce(add, [l1[a]*l1[b] for a in range(n-1) for b in range(a+1,n)]))



### FIXED CODE ###

a,b = map(int,input().split())
print(a-2*b if a-2*b>=0 else 0)
N = int(input())
A = [-1] * N
B = list(map(int, input().split()))

N = int(input())
A = [100001] * N
B = list(map(int, input().split()))

if N == 2:
  print(B[0]*2)
else: 
  for i in range(N-2):
    if A[i] > min(B[i], B[i+1]):
      A[i] = min(B[i], B[i+1])
    if A[i+1] > min(B[i], B[i+1]):
      A[i+1] = min(B[i], B[i+1])

  A[-1] = B[-1]

  print(sum(A))

### FIXED CODE ###

N = int(input())
A = [100001] * N
B = list(map(int, input().split()))

if N == 2:
  print(B[0]*2)
else: 
  for i in range(N-1):
    A[i] = B[i]
  for i in range(N-2):
    if A[i+1] > B[i]:
      A[i+1] = B[i]

  A[-1] = B[-1]

  print(sum(A))
K, X = map(int, input().split())

print('Yes' if X/500<=k else'NO')

### FIXED CODE ###

K, X = map(int, input().split())
 
print('Yes' if X/500<=K else'No')
print((lambda s:[s for s in reversed(range(len(s))) if len(s)%2==0 and s[:len(s)//2]==s[len(s)//2:]][0])(input()))

### FIXED CODE ###

print((lambda s: [len(t) for t in [s[:i] for i in reversed(range(len(s)))] if (len(t)%2==0 and t[:len(t)//2]==t[len(t)//2:])])(input())[0])
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(a(k-1))

### FIXED CODE ###

a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())
print(a[k-1])
a=int(input())
b=[input() for i in range(a)]
c=[AC,WA,TLE,RE]
for value in c:
  print("{0}x{1}".format(value,b.count(value)))
  
  


### FIXED CODE ###

N = int(input())
s = [input() for i in range(N)]
for v in ['AC', 'WA', 'TLE', 'RE']:
  print('{0} x {1}'.format(v, s.count(v)))
N = int(input())
D = [int(i) for i in input().split()]
Dlist = [0]*max(D)
for d in D:
    Dlist[d-1] += 1

M = int(input())
T = [int(i) for i in input().split()]
Tlist = [0]*max(T)
for t in T:
    Tlist[t-1] += 1

flag = True

for i in range(max(T)):
    if Tlist[i] > Dlist[i]:
        flag = False
        break


if flag:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

from collections import Counter
N = int(input())
D = [int(i) for i in input().split()]
M = int(input())
T = [int(i) for i in input().split()]

cD = Counter(D)

for t in T:
    if cD.get(t,0) == 0:
        print('NO')
        exit()
    else:
        cD[t] -= 1

print("YES")
n, m = map(int, input().split())
des= [0]*(n+1)
a = 1
for i in range(0, m):
    b = (list(map(int, input().split())))
    if b[0] == 1:
    	des[b[1]] += 1
    	if des[b[1]] == 2:
    		print('POSSIBLE')
    		a = 0
    		break
    if b[1] == n:
    	des[b[0]] += 1
    	if des[b[0]] == 2:
    		print('POSSIBLE')
    	        a = 0
    		break
    		
if a:
    print('IMPOSSIBLE')

### FIXED CODE ###

import sys 

N,M  = map(int,input().split())
     
a = [[0 for i in range(2)] for j in range(M)]
b = [] 
c = []

for i in range(M):
  a[i][0] , a[i][1] = map(int,input().split())
  first, second = a[i][0],a[i][1]
  if first == 1:
    b.append(second)
  if second == N:
    c.append(first)

b_set = set(b)
c_set = set(c)

if list(b_set & c_set) is None or len(list(b_set & c_set)):
  res = ('POSSIBLE')
else:
  res = ('IMPOSSIBLE')

print(res)
from fractions import Fraction

N = (int(i) for i in input().split()) 
A = [int(i) for i in input().split()] 

A.sort()

res = A[0]
for aa in A:
    res = Fraction.gcd(res, aa)

print(res)

### FIXED CODE ###

import fractions

N = (int(i) for i in input().split()) 
A = [int(i) for i in input().split()] 

A.sort()

res = A[0]
for aa in A:
    res = fractions.gcd(res, aa)

print(res)