Harryxun/stf_run huggingface dataset:
n, m = map(int, input().split())
h = list(map(int, input().split()))
delete_list =[]
pairs = []
for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] > h[b-1]:
        delete_list.append(b)
    if h[a-1] == h[b-1]:
        delete_list.append(a, b)
    else:
        delete_list.append(a)

delete_list = set(delete_list)
print(n - len(delete_list))

### FIXED CODE ###

n, m = map(int, input().split())
h = list(map(int, input().split()))
delete_list =[]
for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] > h[b-1]:
        delete_list.append(b)
    if h[a-1] == h[b-1]:
        delete_list.append(a)
        delete_list.append(b)
    if h[a-1] < h[b-1] :
        delete_list.append(a)

delete_list = set(delete_list)
print(n - len(delete_list))
from collections import deque
N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
a = deque(A)
b = deque(B)
ans = 0
l = len(a) + len(b)
while a and b:
    if K - a[0] >= 0 or K - b[0] >= 0:
        if a[0] > b[0]:
            x = b.popleft()
            K = K - x
            ans += 1
        if a[0] <= b[0]:
            x = a.popleft()
            K = K - x
            ans += 1
    else:
        break
c = a + b
while c:
    if K - c[0] >= 0:
        x = c.popleft()
        K = K - x
        ans += 1
    else:
        break
print(ans)

### FIXED CODE ###

from bisect import bisect
N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
a = [0] * (N+1)
b = [0] * (M+1)
for i in range(N):
    a[i+1] = a[i] + A[i]
for i in range(M):
    b[i+1] = b[i] + B[i]
ans = 0
for i in range(N+1):
    tmp = K - a[i]
    if tmp < 0:
        break
    ans = max(ans, i + bisect(b, tmp) - 1)
print(ans)
a, b = map(int(), input().split()))
if (a*b % 2) == 0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

a,b = map(int, input().split())
c = a * b
if c % 2 == 0:
    print("Even")
else:
    print("Odd")
N = int(input())
C = list(map(int, input().split()))
V = list(map(int, input().split()))
sum = 0
for i in range(N):
    sum += max(0, V[i]-C[i])
print(sum)

### FIXED CODE ###

A,B,C = map(int, input().split())
print(round(C//A*B))
a,b = map(int(input().split()))
if a+b >= 10:
  print("error")
else:
  print(a+b)

### FIXED CODE ###

a,b = map(int,input().split())
if a+b >= 10:
  print("error")
else:
  print(a+b)
h, a = map(int, input().split())

if h%a == 0:
  input(h/a)
else:
  input(h/a+1)

### FIXED CODE ###

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

if h%a == 0:
  print(int(h/a))
else:
  print(int(h/a+1))
s = input().split()
s5 = s.count("5")
s7 = s.count("7")

if s5 == 2:
  if s7 == 1:
    print("YES")
    else:
      print("NO")
else:
    print("NO")

### FIXED CODE ###

s = input().split()
s5 = s.count("5")
s7 = s.count("7")
 
if s5 == 2:
    if s7 == 1:
  	    print("YES")
    else:
        print("NO")
else:
    print("NO")
import itertools

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


a = list(itertools.combinations(l, 3))
b = []

for i in a:
    b.append(tuple(sorted(i)))

c = list(set(b))

count = 0

for i in c:
    if i[0] < i[1] + i[2] and i[1] < i[0] + i[2] and i[2] < i[0] + i[1]:
        count += 1

print(count)        

### FIXED CODE ###

n = int(input())
s = list(input())

ans = 1

for i in range(n-1):
    if s[i] == s[i+1]:
        continue
    else:
        ans += 1

print(ans)
N = int(input())
X = list(map(int,input().split()))
import math
ans = 0
mod = 10**9+7
a = 0
ans = 0
for i in range(N-1):
  a += 1/(i+1)
  ans += (X[i+1]-X[i])*a

ans *= math.factorial(N-1)
print(int(ans)%mod)

### FIXED CODE ###

N = int(input())
X = list(map(int,input().split()))
import math
ans = 0
mod = 10**9+7
a = 0
ans = 0
for i in range(N-1):
  a += pow(i+1,mod-2,mod)
  ans += ((X[i+1]-X[i])%mod)*(a%mod)
  ans %= mod
  
ans *= math.factorial(N-1)%mod

print(ans%mod)
from collections import deque
import numpy as np
import sys

n, m  = map(int, input().split())
g     = {}
maxD  = np.array([-1 for i in range(n)])
color = np.array([0  for _ in range(n)])

for u, v in (map(int, sys.stdin.readline().split()) for _ in [0]*n):
    u-=1
    v-=1
    if u not in g:
        g[u] = []
    if v not in g:
        g[v] = []
    g[u].append(v)
    g[v].append(u)
    
q = int(input())
Q = [list(map(int, l.split())) for l in sys.stdin][::-1]

def bfs(curQ):
    while len(curQ) > 0:
        node, dis, col = curQ.pop()
    
        if maxD[node] > dis:
            continue
            
        if dis < 0:
            continue
            
        maxD[node] = dis
    
        if color[node] == 0:
            color[node] = col

        if node in g:
            for v in g[node]:
                if dis-1 > maxD[v]:
                    curQ.append([v, dis-1, col])
                    
for node, dis, col in Q:
    curQ = deque()
    curQ.append([node-1, dis, col])
    bfs(curQ)

ans = ''
for x in color:
    ans += str(x)+'\n'
print(ans) 


### FIXED CODE ###

n, m  = map(int, input().split())
g     = {}
used  = {i:[False for _ in range(11)] for i in range(n)}
color     = [0  for _ in range(n)]

for _ in range(m):
    u, v = map(int, input().split())
    u-=1
    v-=1
    if u not in g:
        g[u] = []
    if v not in g:
        g[v] = []
    g[u].append(v)
    g[v].append(u)
    
q = int(input())
Q = []

for _ in range(q):
    node, dis, col = map(int, input().split())
    Q.append([node-1, dis, col])
Q = Q[::-1]

def bfs(now, dist, col):
    if dist < 0:
        return
    
    if used[now][dist]:
        return
 
    used[now][dist] = True
    
    if not color[now]:
        color[now] = col
 
    if now in g:
        for x in g[now]:
            bfs(x, dist - 1, col)
            
for node, dis, col in Q:
    bfs(node, dis, col)

for x in color:
    print(x)
n, r = map(int, input().split())

if n >= 10:
    print(r)
else:
    print(r + 100 * (10 - 2n))


### FIXED CODE ###

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

if n >= 10:
    print(r)
else:
    print(r + 100 * (10 - n))
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")


# 処理内容
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))


    C = [0] * N
    D = [0] * N
    for i in range(N):
        C[A[i]-1] += 1
        D[A[i]-1] += 1
    for i in range(N-1):
        C[i+1] += C[i]
        D[i+1] += D[i]
    
    s = -INF
    for i in range(1,N):
        if s < C[i] - D[i-1]:
            s = C[i] - D[i-1]
    
    ans = " ".join(map(str, B[s+1:] + B[:s+1]))
    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")


# 処理内容
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))


    C = [0] * (N+1)
    D = [0] * (N+1)
    for i in range(N):
        C[A[i]] += 1
        D[B[i]] += 1
    for i in range(N+1):
        if C[i] + D[i] > N:
            print("No")
            return
    for i in range(N):
        C[i+1] += C[i]
        D[i+1] += D[i]
    
    x = 0
    for i in range(1, N+1):
        if x < C[i] - D[i-1]:
            x = C[i] - D[i-1]
    

    print("Yes")
    for i in range(N):
        if i != 0:
            print(" ", end="")
        print(B[(i+N-x)%N], end="")
    print("")


if __name__ == '__main__':
    main()
a,b = map(int,input().split())
print(a+(b-a)*2)

### FIXED CODE ###

a = int(input())
b = int(input())
print(a+(b-a)*2)
N=int(input())
for i in range(N)
 l,n=map(int,input().split())
 	ans=l-n+1
print(ans)

### FIXED CODE ###

N = int(input())
ans=0
for i in range(N):
    l,n= map(int, input().split())
    ans=ans+n-l+1
print(ans)
if x == 0:
 print('1')
elif x == 1:
 print('0')

### FIXED CODE ###

x = int(input())
if x == 0:
 print('1')
elif x == 1:
 print('0')
def main():
    n,k = map(int,input().split())
    X = list(map(int,input().split()))

    import bisect

    i = bisect.bisect_left(X,0)
    if X[i] == 0:
        k -= 1


    ans = 10**9
    if k == 0:
        print(0)
        exit()
    for j in range(-k+1,1):
        # print(j)
        if i + j < 0 or i+j+k-1 >len(X)-1:
            continue
        # print(l,r)
        l = X[i+j]
        r = X[i+j+k-1]

        l = min(0,l)
        r = max(r,0)

        a = min(abs(l),abs(r))
        b = max(abs(l),abs(r))

        t = 2*a + b
        ans = min(t,ans)

    print(ans)



main()

### FIXED CODE ###

import bisect

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

s = bisect.bisect_left(X,0)
if 0 in X:
    K -= 1
else:
    bisect.insort_left(X,0)
    N += 1

MIN = 2 * 10**9
for i in range(K+1):
    if s - K + i >= 0 and s + i <N:
        f = X[s -K+i]
        l = X[s+i]
        if abs(f) < abs(l):
            ans = abs(f) * 2 + abs(l)
        else:
            ans = abs(l) * 2 + abs(f)
        MIN =min(MIN,ans)

print(MIN)
a = list(map(int,input().split()))
if (a[0] * 4) >= a[1] and (a[0] * 2) <= a[1] and A[1] % 2 == 0:
    print("Yes")
else:
  print("No")

### FIXED CODE ###

a = list(map(int,input().split()))
if (a[0] * 4) >= a[1] and (a[0] * 2) <= a[1] and a[1] % 2 == 0:
    print("Yes")
else:
  print("No")
X, K, D = map(int, input().split())
X = abs(X)
point = X % D
q = X // D
ans = 0
if q >= K:
    ans = abs(X-D*K)
elif (K - q) % 2 == 0:
    ans = point
else:
    ans = D-point
print(ans)

### FIXED CODE ###

S = input()
cnt = 0
ans = 0
for s in S:
    if s == 'R':
        cnt += 1
    else:
        cnt = 0
    ans = max(ans, cnt)
print(ans)
import collections

class UnionFind:

    def __init__(self, N):
        self.raw = [i for i in range(N)]

    def root(self, i):
        if self.raw[i] == i:
            return i
        self.raw[i] = self.root(self.raw[i])
        return self.raw[i]

    def unite(self, a, b):
        a_root = self.root(a)
        b_root = self.root(b)
        self.raw[a_root] = b_root

    def is_same(self, a, b):
        return self.root(a) == self.root(b)


def solve(N, M, K, AB, CD):
    uf = UnionFind(N)
    minus_count = [0 for _ in range(N)]
    for a, b in AB:
        uf.unite(a - 1, b - 1)
        minus_count[a - 1] += 1
        minus_count[b - 1] += 1
    for c, d in CD:
        if uf.is_same(c - 1, d - 1):
            minus_count[c - 1] += 1
            minus_count[d - 1] += 1
    counter = collections.Counter()
    roots = [uf.root(i) for i in range(N)]
    counter.update(roots)

    ans = []
    for i in range(N):
        ans.append(str(counter[uf.root(i)] - minus_count[i] - 1))
    return " ".join(ans)

if __name__ == "__main__":
    N, M, K = tuple(map(int, input().split(" ")))
    AB = []
    for _ in range(M):
        AB.append(tuple(map(int, input().split(" "))))
    CD = []
    for _ in range(K):
        CD.append(tuple(map(int, input().split(" "))))
    print(solve(N, M, K, AB, CD))


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
import collections

class UnionFind:

    def __init__(self, N):
        self.raw = [i for i in range(N)]

    def root(self, i):
        if self.raw[i] == i:
            return i
        self.raw[i] = self.root(self.raw[i])
        return self.raw[i]

    def unite(self, a, b):
        a_root = self.root(a)
        b_root = self.root(b)
        self.raw[a_root] = b_root

    def is_same(self, a, b):
        return self.root(a) == self.root(b)


def solve(N, M, K, AB, CD):
    uf = UnionFind(N)
    minus_count = [0 for _ in range(N)]
    for a, b in AB:
        uf.unite(a - 1, b - 1)
        minus_count[a - 1] += 1
        minus_count[b - 1] += 1
    for c, d in CD:
        if uf.is_same(c - 1, d - 1):
            minus_count[c - 1] += 1
            minus_count[d - 1] += 1
    counter = collections.Counter()
    roots = [uf.root(i) for i in range(N)]
    counter.update(roots)

    ans = []
    for i in range(N):
        ans.append(str(counter[uf.root(i)] - minus_count[i] - 1))
    return " ".join(ans)

if __name__ == "__main__":
    N, M, K = tuple(map(int, input().split(" ")))
    AB = []
    for _ in range(M):
        AB.append(tuple(map(int, input().split(" "))))
    CD = []
    for _ in range(K):
        CD.append(tuple(map(int, input().split(" "))))
    print(solve(N, M, K, AB, CD))
data = [int(i) for i in input().split()]

data.sort()
print("{0}{1}{2}".format'(data[0],data[1],data[2])')

### FIXED CODE ###

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

data.sort()
print("{0} {1} {2}".format(data[0],data[1],data[2]))
N = int(input())
kk = list(map(int, input().split()))
a = sum(kk)

if N == 1:
  print(0)
else:
  for k in range (N-1):
    if kk[N-k-2] > kk[N-k-1]:
      c = kk[N-k-1:N]
      d=kk[N-k-2]
      c_=[d if i<d else i for i in c]
      kk[N-k-1:N]=c_
  b = sum(kk)
  print(b-a)

### FIXED CODE ###

kk = list(map(int, input().split()))
a = kk[0] - (kk[0] % kk[1])
b = a / kk[1]

if (kk[0] % kk[1]) == 0:
  answer = b * kk[2]
else:
  answer = (b + 1) * kk[2]
print(int(answer))
#!/usr/bin/env python3
import collections

def dfs(n, pre, T, dist, d) :
	dist[n] = d
	for i in T[n] :
		if i[0] != pre :
			dfs(i[0], n, T, dist, d + i[1])


N = int(input())
T = collections.defaultdict(lambda : [])
for i in range(N-1) :
	a, b, c = map(int, input().split())
	T[a].append((b, c))
	T[b].append((a, c))
Q, K = map(int, input().split())

d = {}
dfs(K, -1, T, d, 0)

for i in range(Q) :
	x, y = map(int, input().split())
	print(d[x]+d[y])


### FIXED CODE ###

#!/usr/bin/env python3
import collections
import sys
sys.setrecursionlimit(int(1e7))

def dfs(n, pre, T, dist, d) :
	dist[n] = d
	for i in T[n] :
		if i[0] != pre :
			dfs(i[0], n, T, dist, d + i[1])


N = int(input())
T = collections.defaultdict(lambda : [])
for i in range(N-1) :
	a, b, c = map(int, input().split())
	T[a].append((b, c))
	T[b].append((a, c))
Q, K = map(int, input().split())

d = {}
dfs(K, -1, T, d, 0)

for i in range(Q) :
	x, y = map(int, input().split())
	print(d[x]+d[y])
list_str = []
list1 = []
for i in range(5):
	a = input()
	list_str.append(list(a))
	list1.append(int(a))


abs_max = 10
count = 0
for i in range(5):
	if int(list_str[i][-1]) != 0 and int(list_str[i][-1]) < abs_max:
		abs_max = int(list_str[i][-1])
for i in range(5):
	count += math.ceil(list1[i]/10)

if abs_max == 10:
	print(int(count*10))
else:
	print(int(count*10)-10+abs_max)

### FIXED CODE ###

import math
list_str = []
list1 = []
for i in range(5):
	a = input()
	list_str.append(list(a))
	list1.append(int(a))


abs_max = 10
count = 0
for i in range(5):
	if int(list_str[i][-1]) != 0 and int(list_str[i][-1]) < abs_max:
		abs_max = int(list_str[i][-1])
for i in range(5):
	count += math.ceil(list1[i]/10)

if abs_max == 10:
	print(int(count*10))
else:
	print(int(count*10)-10+abs_max)
N,C = map(int, input().split())
s =[0]*N
t =[0]*N
c =[0]*N
for i in range(N):
    s[i],t[i],c[i] = map(int, input().split())

imos = [0]*int(1e5+1)
for i in range(N):
    imos[s[i]]+=1
    imos[t[i]+1]-=1

ans = 0
for i in range(1,int(1e5+1)):
    imos[i]=imos[i-1]+imos[i]
    ans = max(ans,imos[i])
print(ans)

### FIXED CODE ###

N,C = map(int, input().split())
s =[0]*N
t =[0]*N
c =[0]*N
for i in range(N):
    s[i],t[i],c[i] = map(int, input().split())

imos = [[0]*int(1e5+20) for _ in range(31)]
for i in range(N):
    imos[c[i]][s[i]]+=1
    imos[c[i]][t[i]+1]-=1

ans = 0
for i in range(1,int(1e5+10)):
    sm = 0
    for j in range(31):
        imos[j][i]=imos[j][i-1]+ imos[j][i]
        if imos[j][i] >= 1:
            sm+=1
    ans = max(ans,sm)
print(ans)
s=input()
n=len(s)
if s[0:(n-1)//2:1]==s[(n-1)//2:0:-1] and s[(n+3)//2:n:1]==s[n:(n+3)//2:-1]  and  s=s[::-1]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S = input()
N = len(S)
S1 = S[0:(N-1)//2]
S2 = S[(N+3)//2-1:N+1]
print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else "No")
s = list(str(input()))
if len(s) == 1:
    print("YES")
    exit()
# 1文字と2文字と3文字で場合分けしてみる
jud = len(set(s))
jud_s = list(set(s))

count_0 = s.count(jud_s[0])
count_1 = s.count(jud_s[1])
count_2 = s.count(jud_s[2])

max_c = max(count_0, count_1, count_2)
if abs(max_c -count_0) < 2 and abs(max_c - count_1) <2 and abs(max_c -count_2) < 2:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

s = list(str(input()))
count_0 = s.count("a")
count_1 = s.count("b")
count_2 = s.count("c")
max_c = max(count_0, count_1, count_2)
if abs(max_c - count_0) < 2 and abs(max_c - count_1) < 2 and abs(max_c - count_2) < 2:
    print("YES")
else:
    print("NO")
a,b = map(int, input().split())

print( a*b, 2*(a+b) )


### FIXED CODE ###

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

print( a*b, 2*(a+b) )
a = [int(input()) for i in range(2)]
if (a[0] * a[1]) % 2 == 0:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

a,b = map(int,input().split())
c = 9
if c % (a * b) == 0:
  print("Yes")
else:
  print("No")
S = input()
List = list(S)

ans = 0
arr = []
for i in range(len(List)):
  if List[i] == "A" or List[i] == "C" or List[i] == "G" or List[i] == "T":
    ans += 1
  else:
    arr.appned(ans)
    ans = 0
    
print(max(arr))

### FIXED CODE ###

S = input()
List = list(S)

ans = 0
arr = []
for i in range(len(List)):
  if List[i] == "A" or List[i] == "C" or List[i] == "G" or List[i] == "T":
    ans += 1
  else:
    arr.append(ans)
    ans = 0
    
arr.append(ans)

print(max(arr))
from bisect import bisect
N,C=map(int,input().split())
S=[[int(i) for i in input().split()] for i in range(N)]
Way1=[S[0][1]-S[0][0]]
p1=[]
if Way1[0]>0:
  p1.append(0)
for i in range(1,N):
  Way1.append(Way1[i-1]+S[i][1]-(S[i][0]-S[i-1][0]))
  if p1==[] and Way1[i]>0:
    p_Way1.append([i])
  elif Way1[p1[-1]]<Way1[i]:
    p1.append(i)
    
Way2=[S[-1][1]-(C-S[-1][0])]
p2=[]
if Way2[0]>0:
  p2.append(N-1)
for i in range(1,N):
  Way2.append(Way2[i-1]+S[N-i-1][1]+(S[N-i-1][0]-S[N-i][0]))
  if p2==[] and Way2[i]>0:
    p2.append(N-i-1)
  elif Way2[N-1-p2[-1]]<Way2[i]:
    p2.append(N-i-1)
Way2.reverse()
p2.reverse()

ans=0
for i in p1:
  if i!=N-1:
    j=p2[bisect(p2,i+0.1)]
    ans=max(ans,Way1[i],Way1[i]-S[i][0]+Way2[j],Way1[i]-(C-S[j][0])+Way2[j])
  else:
    ans=max(ans,Way1[i])
for j in p2:
  ans=max(ans,Way2[j])
print(ans)
  

### FIXED CODE ###

from bisect import bisect_right,bisect_left
N,C=map(int,input().split())
S=[[int(i) for i in input().split()] for i in range(N)]
Way1=[S[0][1]-S[0][0]]
p1=[]
if Way1[0]>0:
  p1.append(0)
for i in range(1,N):
  Way1.append(Way1[i-1]+S[i][1]-(S[i][0]-S[i-1][0]))
  if p1==[] and Way1[i]>0:
    p1.append(i)
  elif p1!=[]:
    if Way1[p1[-1]]<Way1[i]:
      p1.append(i)
    
Way2=[S[-1][1]-(C-S[-1][0])]
p2=[]
if Way2[0]>0:
  p2.append(N-1)
for i in range(1,N):
  Way2.append(Way2[i-1]+S[N-i-1][1]+(S[N-i-1][0]-S[N-i][0]))
  if p2==[] and Way2[i]>0:
    p2.append(N-i-1)
  elif p2!=[]:
    if Way2[N-1-p2[-1]]<Way2[i]:
      p2.append(N-i-1)
Way2.reverse()
p2.reverse()

ans=0
for i in p1:
  if i!=N-1:
    if bisect_right(p2,i+0.1)<len(p2):
      j=p2[bisect_right(p2,i+0.1)]
      ans=max(ans,Way1[i],Way1[i]-S[i][0]+Way2[j])
    else:
      ans=max(ans,Way1[i])
  else:
    ans=max(ans,Way1[i])
for j in p2:
  if j!=0:
    if bisect_left(p1,j-0.1)>0:
      i=p1[bisect_left(p1,j-0.1)-1]
      ans=max(ans,Way2[j],Way1[i]-(C-S[j][0])+Way2[j])
    else:
      ans=max(ans,Way2[j])
  else:
    ans=max(ans,Way2[j])
    
print(ans)
while 1:
  x, y = map(int, raw_input().split())
  if x == 0 and y ==0:
    break
  elif y > x:
    print "%d %d" & (y,x)
  else:
    print "&d &d" & (x,y)

### FIXED CODE ###

while 1:
  x, y = map(int, raw_input().split())
  if x == 0 and y ==0:
    break
  elif x > y:
    print "%d %d" % (y,x)
  else:
    print "%d %d" % (x,y)
import sys
input = sys.stdin.readline
from bisect import bisect_left

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

p = []
m = []
zero = 0
for i in range(N) :
  if A[i] > 0 :
    p.append(A[i])
  elif A[i] < 0 :
    m.append(-A[i])
  else :
    zero += 1

p.sort()
m.sort()

ng, ok = -(10 ** 18)-1, 10 ** 18+1
while ok - ng > 1 :
  mid = (ok + ng) // 2
  s = 0 
  if mid < 0 :
    for i in range(len(m)) :
      x = (-mid+m[i]-1) // (m[i])
      s += len(p) - bisect_left(p, x)
    
  else :
    for i in range(len(p)) :
      x = mid // p[i]
      if x < p[i] : break
      s += max(0, bisect_left(p, x + 1) - 1 - i)
    for i in range(len(m)) :
      x = mid // m[i]
      if x < p[i] : break
      s += max(0, bisect_left(m, x + 1) - 1 - i)
    s += (len(p) + len(m)) * zero
    s += len(p) * len(m)
    s += zero * (zero - 1) // 2
  
  if s < K :
    ng = mid
  else :
    ok = mid
    
print(ok)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

p = []
m = []
zero = 0
for i in range(N) :
  if A[i] > 0 :
    p.append(A[i])
  elif A[i] < 0 :
    m.append(-A[i])
  else :
    zero += 1

p.sort()
m.sort()

ng, ok = -(10 ** 18)-1, 10 ** 18+1
while ok - ng > 1 :
  mid = (ok + ng) // 2
  s = 0 
  if mid < 0 :
    j = 0
    for i in range(len(m) - 1, -1, -1) :
      while j < len(p) and m[i] * p[j] < -mid :
        j += 1
      s += len(p) - j
      
  else :
    j = len(p) - 1
    for i in range(len(p)) :
      while j >= 0 and p[i] * p[j] > mid :
        j -= 1
      s += max(0, j - i)
      
    j = len(m) - 1
    for i in range(len(m)) :
      while j >= 0 and m[i] * m[j] > mid :
        j -= 1
      s += max(0, j - i)
      
    s += (len(p) + len(m)) * zero + len(p) * len(m) + zero * (zero - 1) // 2

  if s < K :
    ng = mid
  else :
    ok = mid
    
print(ok)
# -*- coding: utf-8 -*-
a = int(input())
b = list(int(input().split("")))
count = list()
for i in range(a):
  count[i-1] = 0
  while b[i-1] % 2 == 0:
    b[i-1] = b[i-1] / 2
    count[i-1] += 1
print(min(count))

### FIXED CODE ###

# -*- coding: utf-8 -*-
a = str(input())
list(a)
count = 0
if a[0] == "1":
  count += 1
if a[1] == "1":
  count += 1
if a[2] == "1":
  count += 1
print(count)
n = int(input())
a = list(map(int,input().split()))
cnt=0
flag=True
while(flag):
  for i in range(n):
    if(a[i]%2==0):
      a[i]=a[i]//2
    else:
      flag=False
      break
  cnt+=1
print(cnt-1)

### FIXED CODE ###

s=input()
count=0
if(s[0]=='1'):
  count+=1
if(s[1]=='1'):
  count+=1
if(s[2]=='1'):
  count+=1
print(count)
n = int(input())
a = list(map(int, input().split()))

import math
tmp = a[0]
for num in a:
    tmp = math.gcd(tmp, num)           #最大公約数
print(tmp)

### FIXED CODE ###

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

import fractions
tmp = a[0]
for num in a:
    tmp = fractions.gcd(tmp, num)           #最大公約数
print(tmp)
X, Y = map(int, input().split())

if (2*X-Y)%3 or (2*Y-X)%3:
    print(0)
else:
    a, b = (2*X-Y)//3, X-2*a
    MOD = 10**9+7
    n = a+b+1
    fac = [1]*(n+1)
    rev = [1]*(n+1)
    
    for i in range(1,n+1):
        fac[i] = i*fac[i-1]%MOD
        rev[i] = pow(fac[i], MOD-2, MOD)
    comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD

    print(comb(a+b, a))

### FIXED CODE ###

X, Y = map(int, input().split())

mod = 10**9+7
N = 1333334
fac = [1]*(N+1)
rev = [1]*(N+1)
 
for i in range(1,N+1):
  fac[i] = i*fac[i-1]%mod
  rev[i] = pow(fac[i], mod-2, mod)
 
comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%mod

a, b = (2*X-Y)//3, (2*Y-X)//3
if a<0 or b<0 or (2*X-Y)%3 or (2*Y-X)%3:
    print(0)
else:
    print(comb(a+b, a))
a,b,n=map(int,(input().split())
x = min(b-1,n)
print(int(a*x/b)-a*int(x/b))

### FIXED CODE ###

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


ps = int(A / K)
pa = A % K
qs = int(B / K)
qa = B % K

if A==B:
	if pa==0:
		print("OK")
	else:
		print("NG")
else:
	if qs-ps>0:
		print("OK")
	else:
		if pa==0 or qa ==0:
			print("OK")
		else:
			print("NG")