peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = []
B = []
for i in range(M):
  a, b = (map(int, input().split()))
  A.append(a)
  B.append(b)

flg = [1] * N
for i in range(M):
  if flg[A[i]-1] == 1 and H[A[i]-1] < H[B[i]-1]:
    flg[A[i]-1] = 0

for i in range(M):
  if flg[B[i]-1] == 1 and H[A[i]-1] > H[B[i]-1]:
    flg[B[i]-1] = 0

print(sum(flg))
# Judge status: Accepted
nums = input().split()
print(int(nums[0]) * int(nums[1]))
# Judge status: Accepted
n, m = map(int, input().split())
menu = {}

for i in range(n):
  a = list(map(int, input().split()))
  for j in range(1, len(a)):
    if a[j] in menu:
      menu[a[j]] += 1
    else:
      menu[a[j]] = 1

count = 0
for i in menu:
  if menu[i] == n:
    count+=1
print(count)
# Judge status: Accepted
l = list(map(int, input().split()))

n = sorted(l)[1] + sorted(l)[0]

print(sorted(l)[2]*10 + n)
# Judge status: Accepted
from collections import deque
k = int(input())
lun = deque([1,2,3,4,5,6,7,8,9])
for i in range(k - 1):
  left = lun.popleft()
  if left % 10 == 0:
    lun.append(left*10)
    lun.append(left*10 + 1)
  elif left % 10 == 9:
    lun.append(left*10 + 9 - 1)
    lun.append(left*10 + 9)
  else:
    x = left % 10
    lun.append(left*10 + x - 1)
    lun.append(left*10 + x)
    lun.append(left*10 + x + 1)
answer = lun.popleft()
print(answer)
# Judge status: Accepted
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
V = rl()

import heapq

heap = []
for v in V:
	heapq.heappush(heap, v)

while len(heap) >= 2:
	v = heapq.heappop(heap)
	v2 = heapq.heappop(heap)
	nv =(v + v2)/2
	heapq.heappush(heap, nv)
print(heap[0])
# Judge status: Wrong Answer
O = list(input())
E = list(input())
ans =''
for a,b in zip(O,E):
    ans+=a+b
print(ans)
# Judge status: Wrong Answer
n, m = map(int,input().split())
array = [[]for i in range(n)]

for i in range(m):
  a, b = map(int, input().split())
  array[a-1].append(b)
  array[b-1].append(a)

for i in range(n):
  print(len(set(array[i])))
# Judge status: Accepted
from collections import deque
sa = deque(input())
sb = deque(input())
sc = deque(input())

player = "a"
while True:
    if player == "a":
        if len(sa) == 0:
            print("A")
            break
        player = sa.popleft()
    elif player == "b":
        if len(sb) == 0:
            print("B")
            break
        player = sb.popleft()
    else:
        if len(sc) == 0:
            print("C")
            break
        player = sc.popleft()
# Judge status: Wrong Answer
L = []
L.append(list(map(int, input().split())))
L.append(list(map(int, input().split())))
L.append(list(map(int, input().split())))
L.append([L[0][0], L[1][0], L[2][0]])
L.append([L[0][1], L[1][1], L[2][1]])
L.append([L[0][2], L[1][2], L[2][2]])
L.append([L[0][0], L[1][1], L[2][2]])
L.append([L[0][2], L[1][1], L[2][0]])
N = int(input())
B = [int(input()) for i in range(N)]
if any(l in B for l in L):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N = int(input())
i = -1
H = 0
for _ in range (N):
  L = list(map(int, input().split()))
  k = max(L)
  if L.index(k) == i:
    L[L.index(k)] = 0
    k = max(L)
  H += k
  i = L.index(k)
print(H)
# Judge status: Accepted
A,B,C,K = map(int, input().split())
print(A-B if K%2 == 0 else B-A)
# Judge status: Wrong Answer
K = int(input())
n = 1000000

if K % 2 == 0:
    print(-1)
elif K % 7 == 0:
    amari = 10
    for i in range(n):
        if amari % int(9 * (K / 7)) == 1:
            print(i + 1)
            break
        else:
            amari = amari * 10
else:
    amari = 70
    for i in range(n):
        if amari % int(9 * K) == 7:
            print(i + 1)
            break
        else:
            amari = amari * 10
# Judge status: Accepted
import queue

n,m=map(int,input().split())
G=[[] for _ in range(n)]
for index1 in range(m):
    a,b=map(int,input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)


dist=[-1]*n
dist[0]=0
q=queue.Queue()
q.put(0)

while not q.empty():
    now=q.get()
    for next in G[now]:
        if dist[next]>=0:
            continue
        dist[next]=now
        q.put(next)

print('Yes')
for i in range(1,n):
    print(dist[i]+1)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
print((A*B)/2)
# Judge status: Accepted
def main():
    s = input()
    cond = ''.join(sorted(s)) == 'abc'
    print('Yes' if cond else 'No')


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
x=int(input())
while(x%i<1 for i in range(2,x)):
  x+=1
  break
print(x)
# Judge status: Accepted
d,t,s = map(int,input().split())
print(['No','Yes'][d <= s*t])
# Judge status: Wrong Answer
A, B = map(int, input().split())
print((A+B) // 2 if (A+B) % 2 else "IMPOSSIBLE")
# Judge status: Wrong Answer
import sys
import math
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    a,b,c = I2()
    print(0 if a%2 == 0 and b%2 == 0 and c%2 == 0 else min(a*b,b*c))
# Judge status: Accepted
N = int(input())
W = list(map(int, input().split()))
ans = 10000

for i in range(1, N):
    temp_abs = abs(sum(W[:i]) - (sum(W) - sum(W[:i])))
    if temp_abs < ans:
        ans = temp_abs

print(ans)
# Judge status: Wrong Answer
x,y = map(int,input().split())
#if (2*x)<y:
z=y-(2*x) #12本足りない z=12
a=z/2 #a=6 亀に変身する鶴の数

if a<=x and a>=0 and z%2==0:
    print('yes')
else:
    print('no')
# Judge status: Accepted
import bisect

def main():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)

    ans = 0

    for i in range(N):
        for j in range(i+1, N):
            X = L[i] + L[j]
            l = bisect.bisect_left(L, X, lo=j+1)
            ans += (l-(j+1))
            #print(L[j + 1:l])
    print(ans)
    return 0

if __name__ == '__main__':
    main()
# Judge status: Accepted
r1,r2=[input() for _ in range(int(input()))],[input() for _ in range(int(input()))];ans=0
ans=[r1.count(i)-r2.count(i) for i in set(r1)];print(max(0,max(ans)))
# Judge status: Accepted
N = int(input())
res = 0
for i in range(32000):
  if i*i > N:
    res = (i-1)*(i-1)
    break
print(res)
# Judge status: Wrong Answer
n, k = map(int, input().split())
nums = []
ans = 0
for i in range(1, n+1):
    temp = i
    counter = 0
    while k > temp:
        temp *= 2
        counter += 1

    ans += 1/n * (1/2)**counter
    print(counter)
print(ans)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)

if L[0] <= sum(L) - L[0]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,m,k=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
tot_a=0
tot_b=0
#Aだけでどこまでいけるか
a=[0]
b=[0]
for i in range(n):
    a.append(a[-1]+A[i])
for j in range(m):
    b.append(b[-1]+B[j])
#print(a,b)
ans=0
j=m
for i in range(n+1):
    if a[i]>k:
        break
    while a[i]+b[j]>k:
        j-=1
    ans=max(ans,i+j)
print(ans)
# Judge status: Accepted
N = int(input())
h = list(map(int, input().split()))
dp = [10**10 for _ in range(N)]
dp[0] = 0

for i in range(N-1):
    if(i+2 > N-1):
        dp[i+1] = min(dp[i+1], dp[i]+abs(h[i+1]-h[i]))
    else:         
        dp[i+2] = min(dp[i+2], dp[i]+abs(h[i+2]-h[i]))
        dp[i+1] = min(dp[i+1], dp[i]+abs(h[i+1]-h[i]))

print(dp[-1])
# Judge status: Wrong Answer
a, b = map(int, input().split())
s = list(input())
if len(s) != a + b + 1:
    print("No")
elif s[a] != "-":
    print("No")
else:
    for i in range(a):
        if not s[i].isdecimal():
            print("No")
            exit()
    for i in range(a + 1, b):
        if not s[i].isdecimal():
            print("No")
            exit()
    print("Yes")
# Judge status: Accepted
N = int(input())

l0 = 2
l1 = 1

if (N == 1):
    ans = 1
else:
    before = l0
    middle = l1
    
    for i in range(N - 1):
        nextt = before + middle
        before = middle
        middle = nextt
    
    ans = nextt

print(ans)
# Judge status: Accepted
n = int(input())
s = list(map(str,input()))
count = 0
for i in range(1,n):
  if s[i] == "E":
    count += 1
box = [0]*n
box[0] = count
for j in range(1,n):
  if s[j] == "E":
    count -= 1
  if s[j - 1] == "W":
    count += 1
  box[j] = count
print(min(box))
# Judge status: Accepted
import collections

s = input()
t = input()
s = ''.join(sorted(s))
t = ''.join(sorted(t, reverse=True))

for i in range(min(len(s), len(t))):
    if ord(s[i]) > ord(t[i]):
        print('No')
        break
    elif ord(s[i]) < ord(t[i]):
        print('Yes')
        break
    else:
        pass
else:
    if len(s) < len(t):
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
N,M = map(int,input().split())

if N*2>=M:
    print(M//2)
else:
    tmp = M - N*2
    print(tmp//4+N)
# Judge status: Accepted
import sys
n=int(input())
ans=0
for i in range(n):
    d1,d2=map(int,input().split())
    if ans==3:
        continue
    if d1==d2:
        ans+=1
    else:
        ans=0
if ans==3:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
for i in range(n):
  t, x, y = map(int, input().split())
  
    
  if t % 2 == 1:
    if (x + y) % 2 == 1 and x + y <= t:
      continue
    else:
      print('No')
      exit()
  else:
    if t % 4 == 0:
      if x == 0 and y == 0:
        continue
    elif (x + y) % 2 == 0 and x + y <= t:
      continue
    else:
      print('No')
      exit()
print('Yes')
# Judge status: Accepted

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

def isable(n):
    tmp = 0
    for i in range(N):
        tmp += (A[i]-0.5)//n
    if K >= tmp:
        return True
    else:
        return False


left = 0
right = 10**9

while right-left != 1:
    if isable((right+left)//2):
        right=(right+left)//2
    else:
        left=(right+left)//2

print(right)
# Judge status: Wrong Answer
N, K = map(int, input().split())

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

L = [0]*N

for k in range(K):
  for n in range(N):
    a = A[n]
    for i in range(2*a+1):
      p = n - a + i
      if 0 <= p < N:
        L[p] += 1
  A = L
  L = [0]*N
  if k > 41:
    break
print(A)
# Judge status: Accepted
a,b,c = map(int,input().split())
if a <= c <= b or b <= c <= a:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
if(n<=999):
  print("ABC")
else:
  print("ABD")
# Judge status: Accepted
N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')]*N
dp[0] = 0
for i in range(N):
    for k in range(1,K+1):
        if i+k >= N:
            continue
        dp[i+k] = min(dp[i+k],dp[i]+abs(h[i]-h[i+k]))
print(dp[N-1])
# Judge status: Accepted
x, y = map(int, input().split())
a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]

if (x in a and y in a) or (x in b and y in b) or (x == y == 2):
    print('Yes')
    exit()
print('No')
# Judge status: Accepted
def min_dist(n, r):
    max_arg_l = (n - 1) // 2
    max_arg_r = (n + 1) // 2

    return min(abs(max_arg_l - r), abs(max_arg_r - r))

def solve():
    n = int(input())
    a = list(map(int, input().split()))

    max_a = max(a)

    a = list(filter((max_a).__ne__, a))

    arg_max_a = a[0]

    for _a in a:
        if min_dist(max_a, _a) < min_dist(max_a, arg_max_a):
            arg_max_a = _a
    
    print(max_a, arg_max_a)

if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
N,K=map(int, input().split()) 
for i in range(9000):
    if K**i<=N<K**(i+1):
        print(i+1)
# Judge status: Accepted
n=int(input())
l=list(input().split() for i in range(n))
for i in range(n):
    l[i].append(i+1)
for i in range(n):
    l[i][1]=-int(l[i][1])
l.sort()
for i in range(n):
    
    print(l[i][2])
# Judge status: Accepted
k, a, b = map(int, input().split())

if k > a and a+2 <= b:
    print(max((k-a-1) // 2 * (b-a) + b + (k-a-1) % 2, k+1))
else:
    print(k+1)
# Judge status: Wrong Answer
a = list(input())
if all(i=='9' for i in a):
    print(9*len(a))
elif len(a)==1:
    print(a[0])
else:
    print(max(int(a[0])-1, 0)+9*(len(a)-1))
# Judge status: Accepted
def ispalindrome(str): return 1 if str == str[::-1] else 0

sta = input()
N = len(sta)
sta_a = sta[0:(N-1)//2]
sta_b = sta[(N-1)//2+1:]


if ispalindrome(sta) and ispalindrome(sta_a) and ispalindrome(sta_b):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
P, Q, R = map(int, input().split())
ans = min(P+Q, Q+R, R+P)
print(ans)
# Judge status: Accepted


import numpy as np
import fractions as fra


input()
s=set()
c=0
for y in input().split():
    x=int(y)//400
    if(x>=8):
        c+=1
    else:
        s.add(x)

#print(s)
ls=len(s)
print(max(1,ls),end=" ")
print(ls+c)
# Judge status: Accepted
import collections

def myindex(l, x, default=-1):
    if x in l:
        return l.index(x)
    else:
        return default

def main():
    N = int(input())
    a = list(map(int, input().split()))
    
    A = [x//400 for x in a]
    A.sort()
    Aitems = list(zip(*collections.Counter(A).items()))
    cntmin = len([x for x in Aitems[0] if x < 8])
    cntmax = cntmin + len([x for x in A if x >= 8])
    if cntmin == 0:
        cntmin = 1
    print(cntmin, cntmax)

if __name__ == "__main__":
    main()
# Judge status: Accepted
a = int(input())

is_prime = False
a_tmp = a
while is_prime == False:
  cnt = 0
  for i in range(1, a_tmp+1):
    is_div = (a_tmp % i == 0)
    if is_div:
      cnt += 1
  if cnt == 2:
    is_prime = True
    print(a_tmp)
  else:
    a_tmp += 1
# Judge status: Wrong Answer
A,B,K = map(int,input().split())
a = []
b = []

for i in range(1,A+1):
  if A%i==0:
    a.append(i)
for j in range(1,B+1):
  if B%j==0:
    b.append(j)

abset = list(set(a)&set(b))

print(abset[K-1])
# Judge status: Wrong Answer
a=input()
b=a[::-1]
c=zip(a,b)
print(sum(s != t for s,t in c))
# Judge status: Accepted
s = input()
t = input()

for i in range(len(s)):
    if(s[i:]+s[:i])==t:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
n, T = map(int, input().split())
c = [0 for _ in range(n)]
t = [0 for _ in range(n)]
for i in range(n):
    c[i], t[i] = map(int, input().split())

ans = 1001

for i in range(n):
    if t[i] <= T:
        ans = min(ans, c[i])
print(ans if ans != 1001 else "TLE")
# Judge status: Wrong Answer
from collections import deque


k = int(input())
d = deque([1,2,3,4,5,6,7,8,9])

for i in range(k):
    a = d.popleft()
    if a % 10 != 0:
        d.append(a*10 + a % 10 - 1)
    d.append(a*10 + a % 10)
    if a % 10 != 9:
        d.append(i*10 + i % 10 + 1)

print(a)
# Judge status: Accepted
mod = 10**9 + 7
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

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

ans = pow(2,n,mod) -1
ncr = 1
for i in range(1,max(a,b)+1):
  ncr = ncr * (n-i+1) * modinv(i) % mod
  if i == a or i == b:
    ans -= ncr
    if (ans < 0):
      ans += mod
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())

ans = []
n_2 = 1 / n
for i in range(1,n+1):
    c = 0
    while i < k:
        c += 1
        i *= 2
    ans.append(n_2*(0.5**c))

print(sum(ans))
# Judge status: Accepted
S = input()
for i in range(len(S)):
    for j in range(i, len(S)):
        if S[:i] + S[j:] == "keyence":
            print("YES")
            exit()

print("NO")
# Judge status: Wrong Answer
N = int(input())
S = input()

S = list(S)
scount = S.count(".")
kcount = S.count("#")
count = 0
if scount < kcount:

    for i in range(len(S)-1):
        if (S[i]=="#")and(S[i+1]=="."):
            count += 1
            S[i+1] == "#"
else :
    for i in reversed(range(len(S)-1)):
        if (S[i]=="#")and(S[i+1]=="."):
            count += 1
            S[i] == "."

print(count)
# Judge status: Wrong Answer
from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

N, X = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
diff = []
for i in range(0, N - 1):
    diff.append(x[i + 1] - x[i])

if diff:
    ans = gcd_list(diff)
else:
    ans = x[0] - 1

print(ans)
# Judge status: Wrong Answer
a,b,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
lists = [list(map(int,input().split())) for i in range(m)]
a.sort()
b.sort()
Min = min(a) + min(b)
for i in range(m):
    Min = min(Min,a[lists[i][0] - 1] + b[lists[i][1] - 1] - lists[i][2])
print(Min)
# Judge status: Accepted
s = '.'+input()+'.'
t = input()
def onazi(a):
  for i in range(len(t)):
    if a[i] == '?':
      continue
    if a[i] != t[i]:
      return 0
  return 1
cnt=0
for i in range(len(s)-len(t),0,-1):
  if onazi(s[i:i+len(t)])==1:
    cnt+=1
    s = s[:i]+t+s[i+len(t):]
    break
if cnt==0:
  print('UNRESTORABLE')
  exit(0)
g = ''
for i in s[1:-1]:
  if i == '?':
    g+='a'
  else:
    g+=i
print(g)
# Judge status: Wrong Answer
N,K =  [int(x) for x in input().split()]

L = [0]*N
num =1
for i in range(N):
    num = 1
    if i < K:
        while num*(i+1) < K:
            num *= 2
        L[i]= 1/N * 1/num
    else:
        L[i] = 1/N

ans = 0
for i in range(N):
        ans +=L[i]

print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())
if b%2!=0:
	print("No")
elif a>=b//4 and a<=b//2:
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
a = input().split()

if a[0] < a[1]:
    print("unsafe")
else :
    print("safe")
# Judge status: Accepted
import collections

n = int(input())
A = list(int(input()) for i in range(n))

c = collections.Counter(A)

ans = 0

for x in c.values():
    if x % 2 == 1:
        ans += 1

print(ans)
# Judge status: Accepted
N = int(input())

colormap = {'R':0,'G':1,'B':2}
S = [colormap[c] for c in input()]

bads = 0
for i in range(N):
    for s in range(1,(N-i+1)//2):
        bads += int(S[i]^S[i+s]^S[i+2*s] == 3)

totals = [0]*3
for c in S:
    totals[c] += 1

print(totals[0]*totals[1]*totals[2] - bads)
# Judge status: Accepted
S = input()
if int(S[5:7]) <= 4:
    print("Heisei")
else:
    print("TBD")
# Judge status: Accepted
#-*- coding: utf-8 -*-
n,m = map(int,input().split())
c = 1
d = 1
for i in range(1,n):
    c += i

for i in range(1,m):
    d += i

print("0" if n==1 and m==1 else c+d-2)
# Judge status: Accepted
N = int(input())
flug = False
cnt = 0
for _ in range(N):
    D1, D2 = list(map(int, input().split())) 
    if D1 == D2:
        cnt += 1
    else:
        cnt = 0
    if cnt >= 3:
        flug = True
if flug:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import numpy as np
n = int(input())
t,a = map(int,input().split())
h = np.array([int(i) for i in input().split()])

h_temp = h * 0.006 + t
ans = np.abs(h_temp - a).argmin()
print(ans+1)
# Judge status: Wrong Answer

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

A = a[0]
B = a[1]
T = a[2]

cout = 0
loopCount = 1
while True:
    if A >= T + 0.5:
        break
    cout += B
    loopCount += 1
    A = A * loopCount

print(cout)
# Judge status: Accepted
S = list(input())
N = len(S)

a = [0] * (N + 1)
for i in range(N):
    if S[i] == '<':
        a[i + 1] = max(a[i + 1], a[i] + 1)
    # print(a)

for i in reversed(range(N)):
    if S[i] == '>':
        a[i] = max(a[i], a[i + 1] + 1)
    # print(a)

print(sum(a))
# print(a)
# Judge status: Accepted
n, m = map(int, input().split(" "))
arr = list(map(int, input().split(" ")))

amount = sum(arr)
ret = n-amount
if ret < 0:
    print(-1)
else:
    print(ret)
# Judge status: Accepted
#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial
#import sys
#from fractions import gcd
setrecursionlimit(10**6)
input=stdin.readline

n=int(input().rstrip())//2
s=input().rstrip()
#print(s[:n],s[n:],"abc"=="abc")
print("Yes" if s[:n]==s[n:] else "No")
# Judge status: Accepted
n, k, q = map(int, input().split())
b = [k - q] * n

for i in range(q):
    ai = int(input())
    b[ai - 1] += 1

for j in range(n):
    if b[j] > 0:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
def main():
    K, X = map(int, input().split())

    n_min = X - K + 1
    n_max = X + K - 1

    ans = list(range(n_min, n_max+1))
    print(' '.join(str(n) for n in ans))


if __name__ == "__main__":
    main()
# Judge status: Accepted
def actual(n, A):
    if len(set(A)) == len(A):
        return 'YES'

    return 'NO'


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

print(actual(n, A))
# Judge status: Wrong Answer
[x, k, d] = list(map(int, input().split()))
x = abs(x)
howMany = x // d
remainder = x % d
stepLeft = k - howMany
if k < howMany:
    print(abs((howMany - k) * d))
elif stepLeft % 2 == 0:
    print(abs(remainder))
elif stepLeft % 2 == 1:
    print(abs(d - remainder))
# Judge status: Wrong Answer
N=int(input())
print(sum((N//i)*(N//i*1)//2)*i for i in range(1,N+1))
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
dx = tx-sx
dy = ty-sy
print(dx*"R"+dy*"U"+dx*"L"+(dy+1)*"D"+(dx+1)*"R"+(dy+1)*"U"+"L"+"U"+(dx+1)*"L"+(dy+1)*"D"+"R")
# Judge status: Accepted
n = int(input())

if n%2==0:
  print(n//2)
else:
  print(n//2+1)
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    ans = pow(10,N,MOD) - pow(9,N,MOD)*2 + pow(8,N,MOD)
    ans %= MOD
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
	print('Bad')
else:
	print('Good')
# Judge status: Accepted
print('win' if sum([int(s) for s in input().split()]) <= 21 else 'bust')
# Judge status: Accepted
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
print(-1 if max(A, B) >= 10 else A * B)
# Judge status: Accepted
a,b=map(int,input().split())
s=(b-1)//(a-1)
print(s if s==(b-1)/(a-1) else s+1)
# Judge status: Accepted
# ABC081
N = int(input())
A = list(map(int, input().split()))

i = 1
while True:
    for a in A:
        if a % (2**i) == 0:
            pass
        else:
            print(i-1)
            exit()
    i += 1
# Judge status: Accepted
(N, K), *AB = [list(map(int, s.split())) for s in open(0)]
for a, b in sorted(AB):
    K -= b
    if K <= 0:
        print(a)
        break
# Judge status: Wrong Answer
def main():
    A, B, T = map(int, input().split(" "))
    result = 0
    if T > A:
        while T > A - 1:
            result += B
            T -= A
    print(result)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
K,A,B=map(int,input().split())

if B-A>1:
    if K<=A:
        print(K+1)
    else:
        print((B-A)*max(0,math.floor((K-(A-1))/2))+A+1-((K+A)%2))
else:   #B-A<=0
    print(1+K)
# Judge status: Accepted
from collections import Counter
S = sorted(list(input()))
T = sorted(list(input()))

if Counter(Counter(S).values()) == Counter(Counter(T).values()):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s=input()
ans='YES'
while s!='':
  if s[:7]=='dreamer':
    s=s.lstrip('dreamer')
  elif s[:5]=='dream':
    s=s.lstrip('dream')
  elif s[:6]=='eraser':
    s=s.lstrip('eraser')
  elif s[:5]=='erase':
    s=s.lstrip('erase')
  else:
    ans='NO'
    break
print(ans)
# Judge status: Accepted
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
res = 0
p = 0
for a in A:
    if a==0:
        p = 0
    a += p
    res += a//2
    p = a%2
print(res)
# Judge status: Wrong Answer
x = int(input())
if x%11 > 6:
    if x//11==0:
        ans = 2
    else:
        ans = (x//11+1) *2
else:
    if x//11==0:
        ans = 1
    else:
        ans = (x//11+1)*2 -1
print(ans)