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

from itertools import product, combinations
n, k = map(int, input().split())
dots = [list(map(int, input().split())) for _ in range(n)]

ans = float("inf")
for a, b in combinations(dots, 2):
	for c, d in combinations(dots, 2):
		upper = max(a[1], b[1], c[1], d[1])
		lower = min(a[1], b[1], c[1], d[1])
		left = min(a[0], b[0], c[0], d[0])
		right = max(a[0], b[0], c[0], d[0])

		area = (upper - lower) * (right - left)
		num = 0
		for dot in dots:
			if left <= dot[0] <= right and lower <= dot[1] <= upper:
				num += 1
		if num >= k and 0 < area < ans:
			ans = area

print(ans)

### FIXED CODE ###

from itertools import combinations
n, k = map(int, input().split())
dots = sorted([list(map(int, input().split())) for _ in range(n)])

ans = float("inf")
for x1, x2 in combinations(range(n), 2):
	wid = dots[x2][0] - dots[x1][0]
	dots_cand = sorted(dots[x1: x2 + 1], key=lambda x: x[1])
	for y1, y2 in combinations(range(x2 + 1 - x1), 2):
		if y2 - y1 + 1 >= k:
			area = (dots_cand[y2][1] - dots_cand[y1][1]) * wid
			if area < ans:
				ans = area

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

N, M = map(int,input().split())
AB = []
for _ in range(M):
    a,b = map(int,input().split())
    if  a == 1 or b== N:
        AB.append([a,b])
AB.sort()
for ab in AB:
    if ab[0] == 1:
        for  cd in AB:
            if cd[1] == N and ab[1] == cd[0]:
                    print("POSSIBLE")
                    exit()
print("IMPOSSIBLE")

### FIXED CODE ###

N, M = map(int,input().split())
AB = []
for _ in range(M):
    a,b = map(int,input().split())
    if  a == 1 or b== N:
        AB.append((a,b))
set1 = set()
set2 = set()
for ab in AB:
    if ab[0] == 1:
        set1.add(ab[1])
    if ab[1] == N:
        set2.add(ab[0])
if set1 & set2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
### BUGGY CODE ###

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

A.sort(reverse=True)

while True:
    if A.count(0) == N-1:
        break
    A[0] = A[0] % A[1]
    A.sort(reverse=True)

print(max(A))


### FIXED CODE ###

import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

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

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

print(gcd_list(A))
### BUGGY CODE ###

N = int(input())
A = [int(input()) for i in range(N)]
maxa = max(A)
for i in range(N):
    if maxa == A[i]:
        tmp = A.pop(i)
        print(max(A))
        A.insert(i,tmp)
    else:
        print(maxa)

### FIXED CODE ###

N = int(input())
A = [int(input()) for i in range(N)]
maxind = A.index(max(A))
maxa = max(A)
A = sorted(A)
ans = [maxa]*maxind
ans.append(A[-2])
[ans.append(i) for i in [maxa]*(N-maxind-1)]
print(*ans,sep="\n")
### BUGGY CODE ###

N = int(input())

A = [0]*N
for i in range(N):
	A[i] = int(input())

max_val = max(A)

while True:
	flag = True
	for a in A:
		if max_val%a != 0:
			flag = False
			break
	if flag:
		break
	max_val += max_val

print(max_val)

### FIXED CODE ###

from fractions import gcd
from functools import reduce

N=int(input())
T =[int(input()) for i in range(N)]
print(reduce(lambda x,y:x*y//gcd(x,y), T))
### BUGGY CODE ###

import sys
input=sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))

from functools import reduce
import fractions
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
num=lcm_list(a)
ans=0
for tmp in a:
    ans+=num//tmp
print(ans%(10**9+7))

### FIXED CODE ###

import sys
input=sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))

from functools import reduce
import fractions
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
num=lcm_list(a)
ans=0
for tmp in a:
    ans+=num//tmp
print(ans%(10**9+7))
### BUGGY CODE ###

import sys

n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))

d.sort()
t.sort()
cond = 1
cnt = 0
for i in range(m):
	tmp_t = t[i]
	while d != []:
		tmp_d = d.pop(0)
		if tmp_d < tmp_t:
			continue
		elif tmp_d == tmp_t:
			cnt += 1
			break
		else:
			cond = 0
			break
	if cond == 0:
		print("NO")
		sys.exit()

if cnt == m:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

import sys
import collections as c
n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))

D = c.Counter(d)
T = c.Counter(t)

for test in T.keys():
	if D[test] >= T[test]:
		continue
	else:
		print("NO")
		sys.exit()

print("YES")
### BUGGY CODE ###

import sys
input = sys.stdin.readline

n=int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans=0
bfla=0
cfla=0
for i in range(n):
    x=a[i]
    bfla=0
    cfla=0
    for j in range(bfla,n):
        if b[j] > x :
            y=b[j]
            bfla=j
        else:
            continue
        for k in range(cfla,n):
            if c[k]>y:
                z=c[k]
                ans+=n-k
                cfla=k
                break
print(ans)


### FIXED CODE ###

import sys
import bisect
input = sys.stdin.readline

n=int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans=0

for j in range(n):
    al=bisect.bisect_left(a,b[j])
    cl=n-bisect.bisect_right(c,b[j])
    ans+=al*cl
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
S=input()[:-1]
Q=int(input())
r = False
for _ in range(Q):
  qs = input()[:-1].split(' ')
  if len(qs) == 1:
    r = not r
  else:
    if (qs[1] == '1' and (not r)) or (qs[1] == '2' and r):
      S = qs[2] + S
    else:
      S = S + qs[2]
if r:
  print(S[::-1])
else:
  print(S)



### FIXED CODE ###

import sys
from collections import deque
input = sys.stdin.readline
S=deque(input()[:-1])
Q=int(input())
r = False
for _ in range(Q):
  qs = input()[:-1].split(' ')
  if len(qs) == 1:
    r = not r
  else:
    if (qs[1] == '1' and (not r)) or (qs[1] == '2' and r):
      S.appendleft(qs[2])
    else:
      S.append(qs[2])
if r:
  print(''.join(reversed(S)))
else:
  print(''.join(S))
### BUGGY CODE ###

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

s = []
flag = True
cnt = 0
while True:
    for i in range(a):
        if cnt > n:
            break
        s.append('b')
        cnt += 1
    for i in range(b):
        if cnt > n:
            break
        s.append('r')
        cnt += 1
    if cnt > n:
        break
print(s[:n].count('b'))

### FIXED CODE ###

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

ans = 0
ans += n // (a + b) * a
rem = n % (a + b)
if a == 0:
    pass
elif rem > a:
    ans += a
elif rem <= a:
    ans += rem
print(ans)
### BUGGY CODE ###

n,k=map(int,input().split())
mod=998244353
s=set()
for _ in range(k):
  l,r=map(int,input().split())
  for j in range(l,r+1):
    s.add(j)
m=len(s)
dp=[0]*n
dp[0]=1
for i in range(1,n):
  for j in s:
    if i-j>=0:
      dp[i]+=dp[i-j]
print(dp[n-1]%mod)


### FIXED CODE ###

n,k=map(int,input().split())
mod=998244353
l=[0]*n
r=[0]*n
for i in range(k):
  l[i],r[i]=map(int,input().split())
dp=[0]*(n+10)
dp[0]=1
sumdp=[0]*(n+10)
sumdp[1]=1
for i in range(1,n):
  for j in range(k):
    li=max(0,i-r[j])
    ri=max(0,i-l[j]+1)
    dp[i]+=sumdp[ri]-sumdp[li]
  sumdp[i+1]=(sumdp[i]+dp[i])%mod
print(dp[n-1]%mod)
### BUGGY CODE ###

def match(c1, c2):
    return c1 == '?' or c1 == c2 or '?' == c2

a = input()
b = input()
c = input()
A, B, C = len(a), len(b), len(c)
ab, bc, ac = [1] * 20000, [1] * 20000, [1] * 20000

for i in range(A):
    for j in range(B):
        if not match(a[i], b[j]):
            ab[i-j+10000]= 0
for i in range(B):
    for j in range(C):
        if not match(b[i], c[j]):
            bc[i-j+10000]= 0
for i in range(A):
    for j in range(C):
        if not match(a[i], c[j]):
            ac[i-j+10000]= 0
ans = 6000

for i in range(-4000, 4000):
    for j in range(-4000, 4000):
        if ab[i+10000] and bc[j-i+10000] and ac[j+10000]:
            L = min(0, min(i, j))
            R = max(A, max(B+i, C+j))
            ans = min(ans, R-L)
print(ans)
    

### FIXED CODE ###

a = input()
b = input()
c = input()
A, B, C = len(a), len(b), len(c)
ab, bc, ac = [1] * 16000, [1] * 16000, [1] * 16000

for i in range(A):
    if a[i] == '?':
        continue
    for j in range(B):
        if b[j] != '?' and a[i] != b[j]:
            ab[i-j+8000]= 0
for i in range(B):
    if b[i] == '?':
        continue
    for j in range(C):
        if c[j] != '?' and b[i] != c[j]:
            bc[i-j+8000]= 0
for i in range(A):
    if a[i] == '?':
        continue
    for j in range(C):
        if c[j] != '?' and a[i] != c[j]:
            ac[i-j+8000]= 0
ans = 6000

for i in range(-4000, 4000):
    for j in range(-4000, 4000):
        if ab[i+8000] and bc[j-i+8000] and ac[j+8000]:
            L = min(0, min(i, j))
            R = max(A, max(B+i, C+j))
            ans = min(ans, R-L)
print(ans)
### BUGGY CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float('inf') for i in range(n)]
dp[0] = 0

for i in range(n):
    for j in range(1, k + 1):
        if i + j < n:
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]))
        else:
            break

print(dp[n - 1])


### FIXED CODE ###

import sys
input = sys.stdin.readline

n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')] * (n + k + 10)
dp[0] = 0

for i in range(n):
    for j in range(1, k + 1):
        if i + j < n:
            if dp[i + j] == float('inf'):
                dp[i + j] = dp[i] + abs(h[i + j] - h[i])
            else:
                dp[i + j] = min(dp[i + j], dp[i] + abs(h[i + j] - h[i]))
        else:
            break


print(dp[n-1])
### BUGGY CODE ###

from collections import deque
H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

dxs = [0, 0, 1, -1]
dys = [1, -1, 0, 0]
cand = []
for j in range(H):
    for i in range(W):
        if S[j][i] == '#':
            continue
        q = deque()
        q.append((i, j, 0))
        field = [[-1] * W for _ in range(H)]
        while q:
            p = q.popleft()
            for dx, dy in zip(dxs, dys):
                field[p[1]][p[0]] = p[2]
                cand.append(p[2])
                x, y = p[0] + dx, p[1] + dy
                if not (0 <= x < W) or not (0 <= y < H) or S[y][x] == '#' or field[y][x] != -1:
                    continue
                q.append((x, y, p[2] + 1))
print(max(cand))

### FIXED CODE ###

import queue
H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

dxs = [0, 0, 1, -1]
dys = [1, -1, 0, 0]
cand = []
for j in range(H):
    for i in range(W):
        if S[j][i] == '#':
            continue
        q = queue.Queue()
        q.put((i, j, 0))
        field = [[-1] * W for _ in range(H)]
        field[j][i] = 0
        while not q.empty():
            p = q.get()
            for dx, dy in zip(dxs, dys):
                x, y = p[0] + dx, p[1] + dy
                if not (0 <= x < W) or not (0 <= y < H) or S[y][x] == '#' or field[y][x] != -1:
                    continue
                field[y][x] = p[2] + 1
                q.put((x, y, p[2] + 1))
        cand.append(max(max(row) for row in field))
print(max(cand))
### BUGGY CODE ###

n, m = map(int, input().split())
import sys
input = sys.stdin.readline
a = list(map(int, input().split()))

from itertools import combinations_with_replacement
from itertools import groupby

ans = float("inf")
x =sum(a)

for i in combinations_with_replacement(range(n), m):
  m = x
  lis = list(i)
  for j, k in groupby(lis):
    m -= a[j]
    m += a[j]//(2**len(list(k)))
  ans = min(ans, m)
  
print(ans)


### FIXED CODE ###

import heapq
N, M = map(int, input().split())
A = list(map(int, input().split()))
A =[-a for a in A]

heapq.heapify(A)
  
for i in range(M):
  curr = -heapq.heappop(A)
  heapq.heappush(A, -(curr//2))
  
print(-sum(A))
### BUGGY CODE ###

import sys
INF = 1 << 60
MOD = 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()

def resolve():
    ward = 96
    n, s = map(int, input().split())
    mask = int(('1' * 32 + '0' * 64) * (s + 1) , 2)
    Mask = (1 << (s + 1) * ward) - 1
    dp = 0
    res = 0
    for a in map(int, input().split()):
        dp = (dp + 1) * ((1 << a * ward) + 1)
        dp &= Mask
        dp = (dp & (~mask)) + ((dp & mask) >> 64) * ((1 << 64) % MOD)
        res += ((dp >> s * ward) & ((1 << ward) - 1)) % MOD
        res %= MOD

    print(res)
resolve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF = 1 << 60
MOD = 998244353
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n, s = map(int, input().split())
    dp = [0] * (s + 1)
    res = 0
    for a in map(int, input().split()):
        dp[0] += 1
        for i in range(s - a, -1, -1):
            dp[i + a] += dp[i]
            if dp[i + a] >= MOD:
                dp[i + a] -= MOD
        res += dp[s]
        if res >= MOD:
            res -= MOD

    print(res)
resolve()
### BUGGY CODE ###

N,*X = map(int,open(0).read().split())
chu = N//2
for i in range(N):
    copy_X = X[:]
    copy_X.sort()
    copy_X.reverse()
    copy_X.remove(X[i])
    print(copy_X[chu - 1])
    


### FIXED CODE ###

N,*X = map(int,open(0).read().split())
chu = N//2 - 1
nums = sorted(X,reverse=True)
num, num_right = nums[chu], nums[chu + 1]
for x in X:
    print(num if x < num else num_right)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

from heapq import *

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

def Dijkstra(s,g):
    dist = [1e100]*n
    dist[s] = 0
    pq = [(dist[s],s)]
    heapify(pq)
    while pq:
        d,p = heappop(pq)
        if dist[p] < d:continue
        for nxt,c in path[p].items():
            if dist[nxt] > c + d:
                dist[nxt] = c + d
                heappush(pq,(dist[nxt],nxt))
    return dist[g]

path = [{} for _ in range(n)]
road = []
heapify(road)

for i in range(1,n):
    for j in range(i):
        a = A[i][j]
        heappush(road,(a,j,i))
ans = 0
while road:
    a,i,j = heappop(road)
    D = Dijkstra(i,j)
    if D < a:
        ans = -1
        break
    elif D > a:
        path[i][j] = a
        path[j][i] = a
        ans += a
print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline

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

class WarshallFloyd:
    def __init__(self,n):
        self.v = n
        self.d = [[1e100]*n for _ in range(n)]
        for i in range(n):
            self.d[i][i] = 0

    def path(self,x,y,c):
        if x == y:
            return False
        self.d[x][y] = c
        self.d[y][x] = c
        return True

    def build(self):
        for k in range(self.v):
            for i in range(self.v):
                for j in range(self.v):
                    self.d[i][j] = min(self.d[i][j], self.d[i][k] + self.d[k][j])

wf = WarshallFloyd(n)

for i in range(1,n):
    for j in range(i):
        wf.path(i,j,A[i][j])

wf.build()
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        if A[i][j] > wf.d[i][j]:
            print(-1)
            exit(0)
        flag = 1
        for k in range(n):
            if i != k != j:
                if wf.d[i][j] == wf.d[i][k] + wf.d[k][j]:
                    flag = 0
                    break
        if flag:
            ans += A[i][j]
print(ans)
### BUGGY CODE ###

import numpy as np

n, w = map(int, input().strip().split())
data = [list(map(int, input().strip().split())) for _ in range(n)]

# i番目に重さがj以下となるように選んだときの価値の総和の最大値
dp = np.zeros((n, w + 1), dtype=np.int64)

for i in range(0, n):
    for j in range(w + 1):
        # i 番目の品物の重さと価値
        wi, vi = data[i]
        if i == 0:
            take = vi if j - wi >= 0 else 0
            miss = 0
            dp[i][j] = max(take, miss)
        else:
            # i番目の品物を入れる場合
            take = dp[i - 1][j - wi] + vi if j - wi >= 0 else 0
            # 入れない場合
            miss = dp[i - 1][j]
            dp[i][j] = max(take, miss)

print(np.max(dp[n - 1]))


### FIXED CODE ###

n, w = map(int, input().strip().split())
data = [list(map(int, input().strip().split())) for _ in range(n)]

# i番目に重さがj以下となるように選んだときの価値の総和の最大値
dp = [[0] * (w + 1) for _ in range(n)]

for i in range(0, n):
    for j in range(w + 1):
        # i 番目の品物の重さと価値
        wi, vi = data[i]
        if i == 0:
            take = vi if j - wi >= 0 else 0
            miss = 0
            dp[i][j] = max(take, miss)
        else:
            # i番目の品物を入れる場合
            take = dp[i - 1][j - wi] + vi if j - wi >= 0 else 0
            # 入れない場合
            miss = dp[i - 1][j]
            dp[i][j] = max(take, miss)

print(max(dp[n - 1]))
### BUGGY CODE ###

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

P = 10**9+7
dp = [0]*(N+1)

dp[0] = 1
dp[1] = 1

for i in range(1, N):
    if i not in List:
        dp[i+1] = dp[i]+dp[i-1]
    else:
        dp[i] = 0
        dp[i+1] = dp[i-1]
            
print(dp[N]%P)

### FIXED CODE ###

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

P = 10**9+7

dp = [1]*(N+1)

for a in List:
    dp[a]=0

for i in range(1, N+1):
    if (i>=2)&(dp[i]!=0):
        dp[i] = (dp[i-1]+dp[i-2])%P
        
print(dp[N])
### BUGGY CODE ###

N = int(input())
P = list(map(int, input().split()))

counter = 1

for i in range(2, len(P) + 1, 1):
    l = sorted(P[slice(i)])
    b = l[0]
    if b >= P[i-1]:
        counter += 1
    else:
        pass

# for i in range(2, len(P) + 1, 1):
#     sl = slice(i)
#     # print(P[sl])
#     # print(P[i-1])
#     if all(elem >= P[i-1] for elem in P[sl]):
#         counter += 1

print(counter)


### FIXED CODE ###

N = int(input())

nums = input().split()
nums = [int(x) for x in nums]

min = None
count = 0

for idx, num in enumerate(nums):
    if idx == 0:
        min = num
        count += 1
        continue

    if min >= num:
        count += 1
        min = num

print(count)
### BUGGY CODE ###

N = int(input())
array = []

for i in range(N):
    a = input()
    try:
        array.index(a)
        array.remove(a)
    except ValueError:
        array.append(a)

print (len(array))

### FIXED CODE ###

N = int(input())
inputSet = set()

for i in range(N):
    a = input()
    try:
        inputSet.remove(a)
    except KeyError:
        inputSet.add(a)

print (len(inputSet))
### BUGGY CODE ###

import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n, q = nm()
    S = input()
    ans = []
    for i in range(q):
        l, r = nm()
        ans += [S[l - 1:r].count('AC')]
    print(*ans, sep='\n')


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from bisect import bisect_left, bisect_right


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n, q = nm()
    S = input()
    ans = []
    A_pos = []
    C_pos = []
    for i in range(n - 1):
        if S[i] == 'A' and S[i + 1] == 'C':
            A_pos += [i + 1]
            C_pos += [i + 2]
    for i in range(q):
        l, r = nm()
        ans += [bisect_right(C_pos, r) - bisect_left(A_pos, l)]
    print(*ans, sep='\n')


if __name__ == '__main__':
    main()
### BUGGY CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
a = [[i - 1, j - 1] for i, j in enumerate(a)]
g = [[0 for _ in range(n)] for _ in range(n)]
x = [0]

i = 0
j = a[0][1]
while g[i][j] != 1:
    x.append(j)
    g[i][j] = 1
    i = j
    j = a[j][1]

tmp = x.index(x[-1])
if tmp >= k:
    print(x[k] + 1)
else:
    x = x[tmp:-1]
    k = (k - tmp) % len(x)
    print(x[k] + 1)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
a = [i - 1 for i in a]
g = [-1] * n

i = 0
j = 0
while g[j] == -1:
    if i == k:
        print(j + 1)
        exit()
    g[j] = i
    i += 1
    j = a[j]

for i in range((k - g[j]) % (i - g[j])):
    j = a[j]
print(j + 1)
### BUGGY CODE ###

c = [list(map(int,input().split())) for i in range(3)]
for i in range(-101,101):
  for j in range(-101,101):
    for k in range(-101,101):
      a = [i,j,k]
      b = [c[0][0] - a[0] ,c[1][1] - a[1], c[2][2] - a[2]]
      flag = 0
      for x in range(3):
        for y in range(3):
          if a[x]+b[y] != c[x][y]:
            flag = 1
      if flag == 0:
        print("Yes")
        exit()
print("No")

### FIXED CODE ###

c = [list(map(int,input().split())) for i in range(3)]
for i in range(-101,101):
  for j in range(-101,101):
    for k in range(-101,101):
      a = [i,j,k]
      b = [c[0][0] - a[0] ,c[1][1] - a[1], c[2][2] - a[2]]
      flag = 0
      for x in range(3):
        for y in range(3):
          if a[x]+b[y] != c[x][y]:
            flag = 1
      if flag == 0:
        print("Yes")
        exit()
print("No")
### BUGGY CODE ###

A,B,K = map(int,input().split())
for i in range(1,K+1):
  if(A>0):
    A=A-1
  elif(B>0):
    B=B-1
  elif(A==0 and B==0):
    A=A
    B=B
print(A,B)

### FIXED CODE ###

A,B,K = map(int,(input().split()))
rem = A - K
if(A+B < K):
    print('0 0')
elif(rem < 0):
    print('0' + ' ' + str(B+rem))
else:
    print(str(rem) + ' ' + str(B))
### BUGGY CODE ###

import itertools

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

C = list(itertools.combinations(A, 2))
CX = [x[0] * x[1] for x in C]
CX.sort()
print(CX[k-1])

### FIXED CODE ###

# 単純な組み合わせだと計算量がO(n**2)となってしまうので工夫が必要
# 小さい順にK番目の値を求めよ
# ⇄ 判定条件「x以下のものがK個以上ある」を満たす最小のxを求めよ
# ⇄ ・判定条件を満たす最小のx：2分探索 (-10**18 ~ 10**18)
# 　 ・「数列から２個選んだ積がx以下のものが何個あるかを数えて、K個以下か判定せよ」：片方を固定して2分探索で数えていく
import sys
input = sys.stdin.readline

N, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
A = sorted(A)
ok, ng = 10**18, -10**18

# 判定条件を満たす最小のx：2分探索 (-10**18 ~ 10**18)
while ok - ng > 1:
    mid = (ok + ng) // 2
    # 数列から２個選んだ積がx以下のものが何個あるかを数える
    s = 0
    t = 0
    for i in range(N):
        if A[i] > 0:
            # 固定したA[i]が正の場合、積の数列
            # A[i]*A[0], A[i]*A[1], ... , A[i]*A[n-1]
            # つまり、{A[i]*A[j]} j=0~n-1 という数列は単調増加
            # j=JOKの時が「x以下」という条件を満たす最大値とすると、条件を満たす個数はJNG個である
            # 図解すると、
            # x以下(OK), x以下(OK), ..., x以下(OK), xより大きい(NG),...,xより大きい(NG)
            # <------------ JNG個 --------------><----------- N - JNG個 ----------->
            # 二分探索でこの境界値Jを求めにいく
            jok, jng = -1, N
            while jng - jok > 1:
                jmid = (jok + jng) // 2
                if A[i] * A[jmid] <= mid:
                    jok = jmid
                else:
                    jng = jmid
            s += jok + 1
        elif A[i] < 0:
            # 固定したA[i]が負の場合、積の数列
            # A[i]*A[0], A[i]*A[1], ... , A[i]*A[n-1]
            # は単調減少。
            # j=JOKの時が、「x以下」という条件を満たす最小のJだとすると、条件を満たす個数はJ+1個である
            # 図解すると、
            # xより大きい(NG), xより大きい(NG), ..., xより大きい(NG), x以下(OK),...,x以下(OK)
            # <--------------------- JOK個 ---------------------><----- N-JOK個 ------->
            jng, jok = -1, N
            while jok - jng > 1:
                jmid = (jok + jng) // 2
                if A[i] * A[jmid] <= mid:
                    jok = jmid
                else:
                    jng = jmid
            s += (N - jok)
        elif mid >= 0:
            s += N
        if A[i] * A[i] <= mid:
            t += 1
    # 求めたsは条件を満たす順列の個数なので、組み合わせの個数にするために/2する
    total = (s - t) // 2
    # それがK個以上あるかを判定する
    if total >= K:
        ok = mid
    else:
        ng = mid
print(ok)