Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split(" ")))
deta = []
error = False

for i in range(n):
    if n == 0:
        pass
    elif error:
        break
    elif a[i] in deta:
        error = True
        break
    deta.append(a[i])
if error:
    print("NO")
else:
    print("YES")

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split(" ")))
deta = set()
error = False

for i in range(n):
    if n == 0:
        pass
    elif error:
        break
    elif a[i] in deta:
        error = True
        break
    deta.add(a[i])
if error:
    print("NO")
else:
    print("YES")
### BUGGY CODE ###

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

a=[]
b=[]
cnt=0
sum=0

for i in range(0,n):
    ta,tb = map(int,input().split())
    a.append(ta)
    b.append(tb)


while m>0:
    mindex = a.index(min(a))
    sum+=a[mindex]*b[mindex]
    m-=b[mindex]
    sa = a[mindex]
    del b[mindex]
    del a[mindex]

while m<0:
    m+=1
    sum-=sa

print(sum)

### FIXED CODE ###

n,m = map(int,input().split())
data = []
sum=0


for i in range(0,n):
    a,b = map(int,input().split())
    data.append((a,b))

data.sort()

while m>0:
    num = m if m<data[0][1] else data[0][1]
    sum+=data[0][0]*num
    m-=num
    del data[0]

print(sum)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
f=set(a)
s=0
for i in f:
  c=a.count(i)
  if c>i:
    s=s+c-i
  elif c<i:
    s=s+c
print(s)


### FIXED CODE ###

import collections as c
n=int(input())
a=list(map(int,input().split()))
d=c.Counter(a)
k=d.keys()
x=0
for i in k:
  if d[i]>i:
    x+=d[i]-i
  elif d[i]<i:
    x+=d[i]
print(x)
### BUGGY CODE ###

import math
def GCD(a,N):
    gcd = a[0]
    for i in range(1, N):
        gcd = math.gcd(gcd, a[i])
    return gcd


k = int(input())
# h, w = map(int, input().split())
# a = list(map(int, input().split()))
ans = 0
L = []
G = [0] * k**3
for i in range(1, k+1):
    for j in range(1, k+1):
        for l in range(1, k+1):
            _l = sorted([i,j,l])
            if not _l in L:
                L.append(_l.sort())
                g = GCD(_l, 3)
                G[L.index(_l.sort())] = g
                ans += g
            else:
                ans += G[L.index(_l.sort())]
            # ans += 1

print(ans)

### FIXED CODE ###

from math import gcd

# def GCD(a,N):
#     gcd = a[0]
#     for i in range(1, N):
#         gcd = math.gcd(gcd, a[i])
#     return gcd


k = int(input())

ans = 0
L = []
G = [0] * k**3

for i in range(1, k+1):
    for j in range(1, k+1):
        for l in range(1, k+1):
            # _l = sorted([i,j,l])
            # if i==1 or j == 1 or l == 1:
            #     ans += 1
            # elif not _l in L:
            #     L.append(_l)
            #     g = GCD(_l, 3)
            #     G[L.index(_l)] = g
            #     ans += g
            # else:
            #     ans += G[L.index(_l)]
            ans += gcd(i,gcd(j,l))

print(ans)
### BUGGY CODE ###

from collections import deque


H, W = map(int, input().split())
Ch, Cw = map(lambda x: int(x) - 1, input().split())
Dh, Dw = map(lambda x: int(x) - 1, input().split())
maze = [input() for _ in range(H)]

INF = 10 ** 12
path = [[INF] * W for _ in range(H)]  # path: 各マスへの移動コスト

# walk:移動A, warp:移動B
walk = [(0, 1), (0, -1), (-1, 0), (1, 0)]
warp = [(i, j) for i in range(-2, 3)
        for j in range(-2, 3) if (i, j) not in [(0, 0)] + walk]

q = deque()
path[Ch][Cw] = 0
q.append((Ch, Cw, 0))

while q:
    x, y, s = q.popleft()
    for dx, dy in walk:  # 移動A
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s:
            path[nx][ny] = s
            q.appendleft((nx, ny, s))  # 移動Aの場合はコスト0. キューの先頭に追加する.
    for dx, dy in warp:  # 移動B
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s + 1:
            path[nx][ny] = s + 1
            q.append((nx, ny, s + 1))  # 移動Bの場合はコスト1. キューの最後尾に追加する.

ans = path[Dh][Dw] if path[Dh][Dw] < INF else '-1'
print(ans)


### FIXED CODE ###

from collections import deque


H, W = map(int, input().split())
Ch, Cw = map(lambda x: int(x) - 1, input().split())
Dh, Dw = map(lambda x: int(x) - 1, input().split())
maze = [input() for _ in range(H)]

INF = 10 ** 12
path = [[INF] * W for _ in range(H)]  # path: 各マスへの移動コスト

# walk:移動A, warp:移動B
walk = [(0, 1), (0, -1), (-1, 0), (1, 0)]
warp = [(i, j) for i in range(-2, 3)
        for j in range(-2, 3) if (i, j) not in [(0, 0)] + walk]

q = deque()
path[Ch][Cw] = 0
q.append((Ch, Cw, 0))

while q:
    x, y, s = q.popleft()
    for dx, dy in walk:  # 移動A
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s:
            path[nx][ny] = s
            q.appendleft((nx, ny, s))  # 移動Aの場合はコスト0. キューの先頭に追加する.
    for dx, dy in warp:  # 移動B
        nx = x + dx
        ny = y + dy
        if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] == '.' and path[nx][ny] > s + 1:
            path[nx][ny] = s + 1
            q.append((nx, ny, s + 1))  # 移動Bの場合はコスト1. キューの最後尾に追加する.

ans = path[Dh][Dw] if path[Dh][Dw] < INF else '-1'
print(ans)
### BUGGY CODE ###

N , M =map(int , input().split())
S = [k for k in range(0,N)]
H = list(map(int , input().split()))
for i in range(M):
    f , g =map(int , input().split())
    x=f-1
    y=g-1
    if H[x]<=H[y]:
        if x in S:
            S.remove(x)
    if H[x]>=H[y]:
        if y in S:
            S.remove(y)
print(len(S))

### FIXED CODE ###

N , M =map(int , input().split())
S = set(k for k in range(0,N))
H = list(map(int , input().split()))
for i in range(M):
    f , g =map(int , input().split())
    x=f-1
    y=g-1
    if H[x]<=H[y]:
            S.discard(x)
    if H[x]>=H[y]:
            S.discard(y)
print(len(S))
### BUGGY CODE ###

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

sum = 1
i = 0
while i < len(A):
    sum *= A[i]
    i+=1

if sum > 1000000000000000000:
    sum = -1

print(sum)

### FIXED CODE ###

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

sum = 1

if 0 in A:
    sum = 0

else:
    for i in range(len(A)):
        sum *= A[i]
        if sum > 1000000000000000000:
            break
    
if sum > 1000000000000000000:
    sum = -1

print(sum)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n):
	b.append(a[i])
	b.reverse()
for i in range(n-1):
	print(b[i] ,end=" ")
print(b[n-1])

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a.insert(0,0)
b = []
if n%2==0:
	i=n
	while i>=2:
		b.append(a[i])
		i += -2
	k=1
	while k<=n-1:
		b.append(a[k])
		k += 2
else:
	i=n
	while i>=1:
		b.append(a[i])
		i += -2
	k=2
	while k<=n-1:
		b.append(a[k])
		k+=2
for i in range(n-1):
	print(b[i],end=' ')
print(b[n-1])
### BUGGY CODE ###

#!/usr/bin/python

# AtCoder Beginner Contest 084
# D: 2017-like Number

import sys, math

def isPrime(n):
  if n <= 2: return n == 2
  if n % 2 == 0: return False
  maxd = int(math.sqrt(n))
  for d in range(3, maxd + 1, 2):
    if n % d == 0: return False
  return True

def is2017like(n):
  return isPrime(n) and isPrime((n + 1) // 2)

# the number of 2017-like numbers between l and r.
def solve(l, r):
  return len([i for i in range(l, r + 1, 2) if is2017like(i)])

Q = int(sys.stdin.readline())
for i in range(Q):
  l, r = [int(w) for w in sys.stdin.readline().split()]
  print(solve(l, r))


### FIXED CODE ###

#!/opt/local/bin/python3

# AtCoder Beginner Contest 084
# D: 2017-like Number

import sys, math
from itertools import accumulate

MAX_N = 100000

def sieve():
  isprime = [i >= 2 for i in range(MAX_N + 1)]
  for p in range(2, MAX_N + 1):
    if isprime[p]:
      for q in range(p + p, MAX_N + 1, p):
        isprime[q] = False
  return isprime

def isPrime(n):
  isPrime._ = isPrime._ or sieve()
  return isPrime._[n]
isPrime._ = None

def is2017like(n):
  return isPrime(n) and isPrime((n + 1) // 2)

# the number of 2017-like numbers less than or equal to n.
def n2017likeUnder(n):
  if n2017likeUnder._ == None:
    lis = [1 if is2017like(i) else 0 for i in range(MAX_N + 1)]
    n2017likeUnder._ = list(accumulate(lis))
  return n2017likeUnder._[n]
n2017likeUnder._ = None

# the number of 2017-like numbers between l and r.
def solve(l, r):
  return n2017likeUnder(r) - n2017likeUnder(l - 1)

Q = int(sys.stdin.readline())
for i in range(Q):
  l, r = [int(w) for w in sys.stdin.readline().split()]
  print(solve(l, r))
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
number = []
for i in range(1,n):
  number.append(a.count(i))
for i in range(n-1):
  print(number[i])
print(0)

### FIXED CODE ###

import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
for i in range(1,n+1):
  print(c[i])
### BUGGY CODE ###

MOD = 10 ** 9 + 7

s = input()
l = len(s)
dp = [[0 for _ in range(13)] for _ in range(l + 1)]
dp[0][0] = 1
for i in range(l):
    if s[i] == "?":
        for k in range(10):
            for j in range(13):
                pos = (j * 10) + k
                pos %= 13
                dp[i + 1][pos] += dp[i][j]
                dp[i + 1][pos] %= MOD
    else:
        for j in range(13):
            pos = (j * 10) + int(s[i])
            pos %= 13
            dp[i + 1][pos] = dp[i][j]
print(dp[-1][5])

### FIXED CODE ###

MOD = 10 ** 9 + 7

s = input()
l = len(s)
dp = [[0 for _ in range(13)] for _ in range(l + 1)]
dp[0][0] = 1
for i in range(l):
    if s[i] == "?":
        for k in range(10):
            for j in range(13):
                pos = (j * 10) + k
                pos %= 13
                dp[i + 1][pos] += dp[i][j]
                dp[i + 1][pos] %= MOD
    else:
        for j in range(13):
            pos = (j * 10) + int(s[i])
            pos %= 13
            dp[i + 1][pos] = dp[i][j]
print(dp[-1][5])
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))        
D,d = [0]*(n+1),[0]*(n+1)
C = lambda x: x*(x-1)//2
s = 0
for i in set(A):
  D[i] = A.count(i)
  s += C(D[i])
for i in set(A):
  d[i] = s-D[i]+1
for i in A:
  print(d[i])

### FIXED CODE ###

from collections import Counter
n = int(input())
A = list(map(int, input().split()))        
C = lambda x: x*(x-1)//2
s = 0
D = Counter(A)
for i,j in D.items():
  s += C(j)
for i in A:
  print(s-D[i]+1)
### BUGGY CODE ###

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

from math import gcd


f = True
l = 1
for i in range(n):
    x = gcd(a[i],l)
    if x!=1:
        f = False
        break
    l = l*a[i]//x
    
if f:
    print('pairwise coprime')
    exit()

g = a[0]
for i in range(n):
    g = gcd(g,a[i])

if g==1:
    print('setwise coprime')
else:
    print('not coprime')

### FIXED CODE ###

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

from math import gcd
g = a[0]
for i in range(n):
    g = gcd(g,a[i])

if g!=1:
    print('not coprime')
    exit()

f = True
l = set()
for i in a:
    for j in range(2,int(i**0.5)+1):
        if i%j==0:
            if i in l:
                f = False
                break
            l.add(i)
        while i%j==0:
            i = i//j
        if i<2:
            break
    if i>1:
        if i in l:
            f = False
            break
        l.add(i)
        
if f:
    print('pairwise coprime')
else:
    print('setwise coprime')
### BUGGY CODE ###

r, g, b, n = map(int, input().split())
r_num = n // r
g_num = n // g
b_num = n // b
count = 0
for i in range(r_num+1):
    r_r_remain = n - r * i
    if r_r_remain == 0:
        count += 1
    else:
        for j in range(g_num+1):
            r_g_remain = r_r_remain - g * j
            if r_g_remain == 0:
                count += 1
            else:
                for k in range(b_num+1):
                    if r_g_remain - b * k == 0:
                        count += 1
print(count)

### FIXED CODE ###

r, g, b, n = map(int, input().split())
count = 0
for i in range(0, n+1, r):
    rem = n-i
    for j in range(0, rem+1, g):
        if (rem-j)%b==0:
            count += 1
print(count)
### BUGGY CODE ###

[N,L] = [int(x) for x in input().split()]
A = {}
B = [0]*N
ANS = {}
count = 0
for i,x in enumerate(input().split()):
    i = int(i)
    x = int(x)
    B[i] = x
    if x in A : A[x] += [i]
    else : A[x] = [i]
for i in sorted(A) :
    for j in A[i] :
        for k in range(L) :
            if j + k not in ANS :
                ANS[j+k] = i
                count += 1
    if (N-count)**2 > N*N : break
        
for i in range(L):
    if i not in ANS : ANS[i] = min(B[:i+1])
for i in range(L,N):
    if i not in ANS : ANS[i] = min(B[i+1-L:i+1])
for i in range(L-1,N-1) : print(ANS[i], end=" ")
print(ANS[N-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

# -*- coding: utf-8 -*-
from sys import stdin
from bisect import bisect_left

d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()

N = d_in()
A_list = ds_in()
A_list.sort()

ans = 0
while N > 1:
    max_a = A_list.pop()
    N -= 1
    order = len(bin(max_a)) - 3
    if max_a == (1 << order) == A_list[-1]:
        del A_list[-1]
        ans += 1
        N -= 1
    else:
        cand = (1 << (order+1)) - max_a
        idx = bisect_left(A_list, cand)
        if (idx < N) and (cand == A_list[idx]):
            del A_list[idx]
            ans += 1
            N -= 1
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from sys import stdin
import numpy as np
from collections import Counter

d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()

N = d_in()
A_list = np.array(ds_in())
A_list.sort()
EPSILON = 10**(-6)

cand_A = 2 ** (np.log2(A_list + EPSILON).astype(int) + 1) - A_list
idx = np.searchsorted(A_list, cand_A)
A_count = dict(Counter(A_list))

ans = 0
for i in range(N-1, -1, -1):
    if A_count[A_list[i]] <= 0:
        continue
    A_count[A_list[i]] -= 1
    if (A_list[idx[i]] == cand_A[i]) and (A_count[cand_A[i]] > 0):
        ans += 1
        A_count[cand_A[i]] -= 1

print(ans)
### BUGGY CODE ###

import sys
import itertools
sys.setrecursionlimit(10**8)
if __name__ == "__main__":
    N = int(input())
    A = input().split()
    for x in range(N):
        tmp = tuple([y for idx, y in enumerate(A) if idx != x])
        result = tuple(filter(lambda t: t[0] == t[1], itertools.combinations(tmp, 2)))
        print(len(result))


### FIXED CODE ###

import sys
import itertools
from collections import Counter
sys.setrecursionlimit(10**8)
if __name__ == "__main__":
    N = int(input())
    A = input().split()
    counter = Counter(A)
    result = 0
    for c in counter.values():
        result += c*(c-1)//2
    for a in A:
        k = counter[a]
        print(result - k*(k-1)//2 + (k-1)*(k-2)//2)
### BUGGY CODE ###

n=int(input())
a=0
if n==1:
  print(0)
elif n==2:
  print(1)
else:
  for i in range(1,n):
    a+=(n-i)
  print(a)


### FIXED CODE ###

n=int(input())
a=(n-1)*n//2
print(int(a))
### BUGGY CODE ###

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

if n==1:
    print(1)
    exit()
if len(set(orga)) == 1:
    print(0)
    exit()

import collections
c = collections.Counter(orga)
a=[]
for itm in c.items():
    num,cnt=itm
    if cnt==1:
        a.append(num)

aset=set(orga)

def m_div(n,aset):
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            if i!=n and i in aset:
                return False
            if i != n // i:
                if (n//i != n) and (n//i in aset):
                    return False
    return True

ans=0
for num in a:
    if m_div(num,aset):
        ans+=1

print(ans)

### FIXED CODE ###

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

if n==1:
    print(1)
    exit()

maxa=max(a)
dp=[0]*(maxa+100)
for num in a:
    for i in range(2,10**10):
        if num*i > (maxa+50):
            break
        dp[num*i]=1

import collections
c = collections.Counter(a)

aa=[]
for itm in c.items():
    num,cnt=itm
    if cnt==1:
        aa.append(num)

ans=0
for num in aa:
    if dp[num]==0:
        ans+=1
print(ans)
### BUGGY CODE ###

def f(n):
    aa = list(map(int, input().split()))
    bb = list(map(int, input().split()))
    dp = [0] * (n + 1)
    for i in range(1, n + 1):
        mx = i
        for a, b in zip(aa, bb):
            if i >= a:
                tmp = dp[i - a] + b
                if tmp > mx:
                    mx = tmp
        dp[i] = mx
    n = dp[-1]
    dp = [0] * (n + 1)
    for i in range(1, n + 1):
        mx = i
        for a, b in zip(aa, bb):
            if i >= b:
                tmp = dp[i - b] + a
                if tmp > mx:
                    mx = tmp
        dp[i] = mx
    print(dp[-1])

n = int(input())
f(n)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)

def don(dk, rate, amin):
    if not rate:
        return dk
    if len(rate)==1:
        a,b=rate[0]
        p,m=divmod(dk,a)
        return p*b+m
    if len(rate)==2:
        a0,b0=rate[0]
        a1,b1=rate[1]
        if b0/a0<b1/a1:
            a0,b0,a1,b1=a1,b1,a0,b0
        p0,m=divmod(dk,a0)
        re=b0*p0
        p1,m=divmod(m,a1)
        re+=b1*p1+m
        while p0>0 and m>0:
            p0-=1
            m+=a0
            p2,m=divmod(m,a1)
            p1+=p2
            tmp=p0*b0+p1*b1+m
            if tmp>re:
                re=tmp
        return re
    if dk < amin:
        return dk
    if dp[dk] != -1:
        return dp[dk]
    mx = 0
    for a, b in rate:
        if a > dk: continue
        tmp = don(dk - a, rate, amin) + b
        if tmp > mx:
            mx = tmp
    dp[dk] = mx
    return mx

n = int(input())
aa = list(map(int, input().split()))
bb = list(map(int, input().split()))
atob = []
btoa = []
amin = 10 ** 7
bmin = 10 ** 7
for a, b in zip(aa, bb):
    if a < b:
        atob.append([a, b])
        if a < amin:
            amin = a
    elif a > b:
        btoa.append([b, a])
        if b < bmin:
            bmin = b
dp = [-1] * (n + 1)
n = don(n, atob, amin)
dp = [-1] * (n + 1)
print(don(n, btoa, bmin))
### BUGGY CODE ###

N=int(input())
P= [list(map(int,input().split()))]
a=1

for i in range(0,len(P[0])):
    a=a*P[0][i]

if a<= 10**18:
    print(a)
else:
    print(-1)
    


### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort()
B=1
for i in A:
  B*=i
  if(B>10**18):
    B=-1
    break
print(B)
### BUGGY CODE ###

import bisect
N, K = map(int, input().split())
A = sorted(map(int, input().split()))
ok = -10**20  # There are <= K pairs <= ok
ng = 10**20   
# x, count

while ok + 1 < ng:
  x = (ok + ng) //2
  count = 0
  for i, a in enumerate(A):
    if a > 0:
      j = bisect.bisect_right(A, x // a)
      if i < j:
        count += j - 1
      else:
        count += j
    elif a < 0:
      j = bisect.bisect_left(A, - (-x // a))
      #print(x, a, -(-x//a), j)
      if i >= j:
        count += N - j - 1
      else:
        count += N - j
    else: # a == 0
      if x >= 0:
        count += N-1
    #print(x, a, count)
  count //= 2
  #print(x, count)
  if count < K:
    ok = x
  else:
    ng = x
  
  
print(ng)


### FIXED CODE ###

def main(N, K, A):
  cp = 0
  cn = 0
  cz = 0
  An = []
  Anp = []
  Ap = []
  for a in A:
    cp += a > 0
    cn += a < 0
    cz += a == 0
    if a > 0:
      Ap.append(a)
    if a < 0:
      An.append(a)
      Anp.append(-a)
  Anp = sorted(Anp)
	
  if K <= cn * cp:
    # negative 
    #print(K)
    
    ok = -10**20  # There are <= K pairs <= ok
    ng = 0
    # x, count

    while ok + 1 < ng:
      x = (ok + ng) //2
      count = 0
      i_an = -1
      for i, a in enumerate(Ap): # a: increasing -> x // a increasing
        while i_an + 1 < len(An) and An[i_an + 1]* a <= x:
          i_an += 1

        count += i_an + 1
        #print(x, a, count)
      #print(x, count)
      if count < K:
        ok = x
      else:
        ng = x
    return ng
  elif K <= cn * cp + cz * (cp + cn) + (cz - 1 )* cz //2:
    
    return 0
  else:
    # positive
    #print(K)
    K -=  cn * cp + cz * (cp + cn) + (cz - 1 )* cz //2
    #print(K)
    ok = 0
    ng = 10**20  # There are <= K pairs <= ok
    # x, count

    while ok + 1 < ng:
      x = (ok + ng) //2
      count = 0
      for Aa in [Ap, Anp]:
        i_ap = -1
        for i, a in zip(range(len(Aa)-1, -1, -1), Aa[::-1]):
          # a: decreasing -> x // a increasing
          while i_ap+1 < len(Aa) and Aa[i_ap+1] * a <= x:
            i_ap += 1
          count += i_ap + 1
          count -= i <= i_ap
          #print(x, a, count, i, i_ap, Aa)
      count //= 2
      #print(x, count)
      if count < K:
        ok = x
      else:
        ng = x
    return ng

N, K = map(int, input().split())
A = sorted(map(int, input().split()))
print(main(N,K,A))
#pairs = []
#for i in range(len(A)):
#  for j in range(i + 1, len(A)):
#    pairs.append(A[i]*A[j])
#pairs.sort()
#for K, p in zip(range(1, N*(N+1)//2+1), pairs):
#  
#  result = main(N, K, A)
#  if result != p:
#    print(K, p, result)
#print('done')
### BUGGY CODE ###

n = int(input())
l = list(map(int,input().split()))
l.sort()

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        sum=l[i]+l[j]
        for k in range(j+1,n):
            if l[k]<sum:
                ans+=1
            else:
                break
print(ans)


### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
l.sort()


ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        sum=l[i]+l[j]
        left=j
        right=n-1
        mid=(left+right)//2
        while right-left>1:
            if l[mid]>=sum:
                right = mid
            else:
                left = mid
            mid = (left+right)//2
        if l[mid+1]<sum:
            mid+=1
        ans+=mid-j
print(ans)
### BUGGY CODE ###

N=int(input())
L=list(map(int, input().split()))
a=0
L.sort()
for i in range(0,N-2,1):
  for j in range(i+1,N-1,1):
    ke=L[i]+L[j]
    t=L[j+1:]
    left=0
    right=len(t)
    while left<right:
      mid=(left+right)//2
      if ke<=t[mid]:
        right=mid
      else:
        left=mid+1
    a+=left
print(a)

### FIXED CODE ###

from bisect import bisect_left
N=int(input())
L=list(map(int,input().split()))

L.sort()
a=0
for i in range(N-2):
    for j in range(i+1,N-1):
        a+=bisect_left(L,L[i]+L[j])-j-1
print(a)
### BUGGY CODE ###

S=input()
src={0:0}
ans=0
pre=0
for s in range(len(S)):
  a=(int(S[-(s+1)])*(10**s)+pre)%2019
  if a not in src.keys():
    src[a]=1
  else:
    ans+=src[a]
    src[a]+=1
  pre+=int(S[-(s+1)])*(10**s)
print(ans+src[0])

### FIXED CODE ###

S=input()
N=len(S)

a=0
t=1
d=[0]*2019
d[0]=1
for i in range(N):
  a+=int(S[N-1-i])*t
  a%=2019
  t*=10
  t%=2019
  d[a]+=1

ans=0
for n in d:
  ans += n*(n-1)//2
print(ans)
### BUGGY CODE ###

a, b = map(int, input().split())
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
n = gcd(a, b)

def cd(num):
    k = []
    for i in range(1,num+1):
        if num%i == 0:
            if is_prime(i):
                k.append(i) 
    return k

def is_prime(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True


gc = gcd(a,b)
c = cd(gc)

print(len(c))

### FIXED CODE ###

def f(n):
    res = set()
    for i in range(2, int(n ** 0.5)):
        if n % i: continue
        while not n % i: n //= i
        res.add(i)
    return res | {n}
 
a, b = map(int,input().split())
print(len(f(a) & f(b) | {1}))