Harryxun/stf_run huggingface dataset:
def sieve(n, a, b):
    ans = 0
    can_divide = [False] * (n + 1)
    can_divide[0] = False
    can_divide[1] = True
    ans += 1
    for i in range(2, int(n ** 0.5) + 1):
        if can_divide[i] is False and a % i == 0 and b % i == 0:
            ans += 1
            for j in range(i * 2, n + 1, i):
                can_divide[j] = True

    return ans


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

m = min(a, b)

ans = sieve(m, a, b)

print(ans)


### FIXED CODE ###

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


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

g = gcd(a, b)
num = g

ans = 1

for i in range(2, int(g ** 0.5) + 1):

    if num % i == 0:
        ans += 1
        while num % i == 0:
            num = num // i

if num != 1:
    ans += 1

print(ans)
import numpy as np
import sys

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

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

def get_good(a, v):
    if v is not None:
        return max(a[a < v])
    else:
        max(a)

value = 0
a = b = c = None
for i in range(K):
    print(get_good(A, a) + get_good(B, b), get_good(C, c))
    a = get_good(a)
    b = get_good(b)
    c = get_good(c)


### FIXED CODE ###

from heapq import heappush, heappop

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

A = sorted([int(e) for e in input().split()], reverse=True)
B = sorted([int(e) for e in input().split()], reverse=True)
C = sorted([int(e) for e in input().split()], reverse=True)


def get_value(ai, bi, ci):
    return -(A[ai] + B[bi] + C[ci])


heap = []
heappush(heap, (get_value(0, 0, 0), 0, 0, 0))
used = {(0, 0, 0)}

for k in range(K):
    v, ia, ib, ic = heappop(heap)
    print(-v)

    if ia + 1 < X and (ia + 1, ib, ic) not in used:
        heappush(heap, (get_value(ia + 1, ib, ic), ia + 1, ib, ic))
        used.add((ia + 1, ib, ic))
    if ib + 1 < Y and (ia, ib + 1, ic) not in used:
        heappush(heap, (get_value(ia, ib + 1, ic), ia, ib + 1, ic))
        used.add((ia, ib + 1, ic))
    if ic + 1 < Z and (ia, ib, ic + 1) not in used:
        heappush(heap, (get_value(ia, ib, ic + 1), ia, ib, ic + 1))
        used.add((ia, ib, ic + 1))
word = list(input())

count = 0  # 入れ替える個数を用意

if len(word) % 2 == 0:  # もしアルファベットの数が偶数の時
	for i in range(0,int(len(word)/2)):
    	if word[i] != word[len(word)-1-i]:
        	count += 1    
    print(count)

else:
	for j in range(0,int((len(word)+1)/2-1)):
    	if word[j] != word[len(word)-1-j]:
        	count += 1            
    print(count)

### FIXED CODE ###

word = list(input())

count = 0  # 入れ替える個数を用意

if len(word) % 2 == 0:  # もしアルファベットの数が偶数の時
  for i in range(0,int(len(word)/2)):
    if word[i] != word[int(len(word))-1-i]:
      count += 1    
  print(count)

else:
  for j in range(0,int((len(word)+1)/2-1)):
    if word[j] != word[int(len(word))-1-j]:
      count += 1
  print(count)
import sys

s=input()
k=int(input())


i=0
while i<k:
    if s[i]=="1":
        i+=1
    else:
        print(s[i])
        sys.exit()
print(s[i])

### FIXED CODE ###

import sys

s=input()
k=int(input())


i=0
while i<len(s) and i<k:
    if s[i]=="1":
        i+=1
    else:
        print(s[i])
        sys.exit()
print("1")
NM=input().split()
N=int(NM[0])
M=int(NM[1])#必要な本数
A=[]
B=[]
for i in range(N):
  AB=input().split()
  A.append(int(AB[0]))
  B.append(int(AB[1]))
money=0
while A!=[]:
  if M>B[A.index(min(A))]:
    money+=min(A)*B[A.index(min(A))]
    #消す
    ai=A.index(min(A))
    A.remove(min(A))
    B.remove(B[ai])
  elif M<B[A.index(min(A))]:
    money+=min(A)*M
    break
  elif M==B[A.index(min(A))]:
    money+=min(A)*M
    break
  else:
    pass
print(str(money))


### FIXED CODE ###

GR=input().split()
G2R2=input().split()
G=int(GR[0])
R=int(GR[1])
G2=int(G2R2[0])
R2=int(G2R2[1])
print(str(G*R-(G2*R+R2*G-G2*R2)))
for line in sys.stdin.readlines():
    print sum(map(int,line.rstrip().split()))

### FIXED CODE ###

import sys
for line in sys.stdin.readlines():
    print sum(map(int,line.rstrip().split()))
import sys
for n in sys.stdin:
    ans = []
    n = int(n)
    nb = format(n,'b')
    nb.reverse
    nb += " "*(10-len(nb))
    for i in xrange(10):
    	if nb[i] == 1:
    		ans.append(str(2**(9-i))
    print ' '.join(ans)

### FIXED CODE ###

import sys
nyu = sys.stdin.read()
nyu = map(int,nyu.split())
for n in nyu:
   	ans = []
	for b in [512,256,128,64,32,16,8,4,2,1]:
		if n >= b:
			n -= b
			ans.append(b)
	ans.reverse()
	ans = map(str,ans)
	ans = ' '.join(ans)
	print ans
n = int(input())
map_list = []
for _ in range(n):
    map_list.append(input().split())


def function():
    x = map_list[-1][0]
    y = map_list[-1][1]
    h = map_list[-1][2]

    for i in range(101):
        for j in range(101):
            cont_check = True
            H = abs(i - int(x)) + abs(j - int(y)) + int(h)
            #print('base:',i, j, H)
        
            for data in map_list[:-1]:
                x, y, h = data
                h = max(int(h), 0)
                #print('check:',i, j, H, abs(i - int(x)) + abs(j - int(y) + int(h)))
                if int(h) != max(H - abs(i - int(x)) - abs(j - int(y)), 0):
                    cont_check = False
                    break
            if cont_check and H >= 1:
                return i, j, H
            
i, j, H = function()
print(i, j, H)

### FIXED CODE ###

n = int(input())
map_list = []
for _ in range(n):
    map_list.append(input().split())

def function():
    for i in range(101):
        if int(map_list[i][2]) > 0:
            x = int(map_list[i][0])
            y = int(map_list[i][1])
            h = int(map_list[i][2])
            break
        else:
            continue

    for i in range(101):
        for j in range(101):
            cont_check = True
            H = abs(x - i) + abs(y - j) + h
            
            for data in map_list:
                xx, yy, hh = map(int, data)
                if hh != max(H - abs(xx - i) - abs(yy - j), 0):
                    cont_check = False
                    break
            if cont_check:
                return i, j, H

i, j, H = function()
print(i, j, H)
n, k = map(int,input().split())
h =[int(input()) for i in range(n)]
h.sort()
ans = 100000000

for i in range(len(h)-k+1):
    if h[i+k-1] - h[i] < ans:
        ans = h[i+k-1] - h[i]
        if ans = 0:
            break

print(ans)

### FIXED CODE ###

n, k = map(int,input().split())
h =[int(input()) for i in range(n)]
h.sort()
ans = 1000000000000

for i in range(len(h)-k+1):
    if h[i+k-1] - h[i] < ans:
        ans = h[i+k-1] - h[i]
        if ans == 0:
            break

print(ans)
import sys
N = 8
ptn = [18,48,6,30,20,34,16]
def f(D):
    i = 0
    s = 0
    D = D[D.index("1"):]
    for c in D:
        if c=="1": s += i
        i += 1
    p = "ABCDEF"[ptn.index(s)]
    return p
 
i=0
D=""
for s in sys.stdin:
    if i<8:
        D+=s[:-1]
        i+=1
    else:
        print f(D)
        i=0
        D=""
print f(D)

### FIXED CODE ###

import sys
ptn = [18,48,6,30,20,34,16]

def f(D):
    i = 0
    s = 0
    D = D[D.index("1"):]
    for c in D:
        if c=="1": s += i
        i += 1
    p = "ABCDEFG"[ptn.index(s)]
    return p

i=0
D=""
for s in sys.stdin:
    if i<8:
        i+=1
        D+=s[:-1]
    else:
        print f(D)
        i=0
        D=""
print f(D)
K X = map(int,input().split())
if 500*K >= X:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if 500*K >= X:
  print('Yes')
else:
  print('No')
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    limit = total_votes / (4.0 * M)
    
    cnt = 0
    for vote in votes:
        if vote >= limit:
            cnt += 1
    	if cnt >= M:
            return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))


### FIXED CODE ###

def popularity(votes, N, M):
    
    total_votes = sum(votes)
    limit = total_votes / (4.0 * M)
    
    cnt = 0
    for vote in votes:
        if vote >= limit:
            cnt += 1
    
    if cnt >= M:
        return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))
n = input()
S = set(int(input()) for in range(n))
print(len(S))

### FIXED CODE ###

n = int(input())
S = set([int(input()) for i in range(n)])
print(len(S))
def lam(x,mod):
	ans=1
	for i in range(1,x+1):
		ans*=i
        ans%=mod
	return ans
n,m=map(int,input().split())
n,m=min(n,m),max(n,m)
mod=10**9+7
if n<m-1:
	print(0)
	exit()
if n+1==m:
	print(lam(n,mod)*lam(m,mod)%mod)
else:
	print(2*lam(n,mod)**2%mod)


### FIXED CODE ###

def lam(x,mo):
	ans=1
	for i in range(1,x+1):
		ans*=i
		ans%=mo
	return ans
n,m=map(int,input().split())
n,m=min(n,m),max(n,m)
mod=10**9+7
if n<m-1:
	print(0)
	exit()
if n+1==m:
	print(lam(n,mod)*lam(m,mod)%mod)
else:
	print(2*(lam(n,mod)**2)%mod)
s = input()
x = [ '0', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN' ]
for i in range x:
     if s == x[i]:
          print(i)

### FIXED CODE ###

s = input()
x = [ '0', 'SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
for i in range(len(x)):
     if s == x[i]:
          print(i)
import numpy as np
ans = np.full((6, 6), "=")
ans[np.tri(6) == 0] = "<"
ans[np.tri(6).T == 0] = ">"
X, Y = map(lambda x: ord(x) - 65, input().split())
print(ans[X][Y])


### FIXED CODE ###

import numpy as np
ans = ["<", "=", ">"]
m = np.full((6, 6), 1, np.int64)
m[np.tri(6) == 0] = 0
m[np.tri(6).T == 0] = 2
X, Y = map(lambda x: ord(x) - 65, input().split())
print(ans[m[X][Y]])
n = int(input())
    xor_arr = list(map(int, input().split()))
    xor_of_xor = 0
    for elm in xor_arr:
        xor_of_xor = xor_of_xor ^ elm
    scarf_val = [xor_of_xor ^ elm for elm in xor_arr]
     
    print(" ".join(str(x) for x in scarf_val))

### FIXED CODE ###

n = int(input())
xor_arr = list(map(int, input().split()))
xor_of_xor = 0
for elm in xor_arr:
    xor_of_xor = xor_of_xor ^ elm
scarf_val = [xor_of_xor ^ elm for elm in xor_arr]
         
print(" ".join(str(x) for x in scarf_val))
X,Y,A,B,C = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

a = p[:X]
b = q[:Y]
p_c = -1
q_c = -1
r_c = 0
k = 0

ans = sum(a)+sum(b)
while(True):
    if a[p_c] >= b[q_c]:
        if b[q_c] < r[r_c]:
            ans += ( r[r_c] - b[q_c] )
            r_c += 1
            q_c -= 1
        else:
            k = 1

    else:
        if a[p_c] < r[r_c]:
            ans += (r[r_c] - a[p_c])
            r_c += 1
            p_c -= 1
        else:
            k = 1

    if k == 1 or r_c >= C:
        break

print(ans)

### FIXED CODE ###

X,Y,A,B,C = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

a = [10**10]*(10**5)
a.extend(p[:X])
b = [10**10]*(10**5)
b.extend(q[:Y])
p_c = -1
q_c = -1
r_c = 0
k = 0

ans = sum(p[:X])+sum(q[:Y])
while(True):
    if a[p_c] >= b[q_c]:
        if b[q_c] < r[r_c] and q_c >= - Y:
            ans += ( r[r_c] - b[q_c] )
            r_c += 1
            q_c -= 1
        else:
            k = 1

    else:
        if a[p_c] < r[r_c]:
            ans += (r[r_c] - a[p_c])
            r_c += 1
            p_c -= 1
        else:
            k = 1

    if k == 1 or r_c >= C:
        break

print(ans)
from sys import stdin, exit
  
def max_heapify(a, i):
    heap_size = a[0]
  
    L = 2*i
    R = 2*i + 1
    if L <= heap_size and a[L] > a[i]:
        largest = L
    else:
        largest = i
    if R <= heap_size and a[R] > a[largest]:
        largest = R
    if largest != i:
        a[i], a[largest] = a[largest], a[i]
        max_heapify(a, largest)
  
  
def main():
    ret = []
    heap = [-1] * 2000001
    heap[0] = 1
    for cmd in stdin:
        if cmd[0] == 'i':
            heap[0] += 1
            i = heap[0]
            heap[i] = int(cmd[7:])
  
            half = i // 2
            while i > 1 and heap[half] < heap[i]:
                heap[i], heap[half] = heap[half], heap[i]
                i //= 2
                half = i // 2
        elif cmd[1] == 'x':
            ret.append(heap[1])
            heap[1] = heap[heap[0]]
            heap[0] -= 1
            max_heapify(heap, 1)
        elif cmd[1] == 'n':
            sys.stdout.writelines("\n".join([str(s) for s in ret]))
            print()
            exit(0)
  
  
main()

### FIXED CODE ###

import heapq
import sys

h = []

for com in sys.stdin.readlines():
    if com[0] == "i":
        heapq.heappush(h, -int(com[7:]))
    elif com[1] == "x":
        print(-heapq.heappop(h))
a = input()
if a%10 == 3:
  print('bon')
elif a%10 == 0 or a%10 ==1 or a%10 ==6 or a%10 ==8:
  print('pon')
else:
  print('hon')


### FIXED CODE ###

a = int(input())
if a%10 == 3:
  print('bon')
elif a%10 == 0 or a%10 ==1 or a%10 ==6 or a%10 ==8:
  print('pon')
else:
  print('hon')
s = input()
AKB = "KIHBR"
tmp = 0
count = 0
for i in range(len(s)):
  if s[i] == "A" and count < 4:
    count += 1
  elif s[i] == AKB[tmp]:
    tmp += 1
  else:
    break

if count <= 4 and tmp == 5:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

s = input()
rep = s.replace("A","")

if rep == "KIHBR" and "AA" not in s and "KIH" in s :
  print("YES")
else:
  print("NO")
from collections import defaultdict
edges = []
to = defaultdict(list) # 1から到達できるか
ot = defaultdict(list) # Nから到達できるか
N, M, P = map(int, input().split())
visited_toN = [False]*(N+1)
visited_fm1 = [False]*(N+1)    
for i in range(M):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    edges.append((a,b,-c+P))
    to[a].append(b)
    ot[b].append(a)

def dfs(v):
    global visited_fm1
    if visited_fm1[v]:return
    visited_fm1[v] = True
    for nxt in to[v]:
        dfs(nxt)
    
def dfs_r(v):
    global visited_toN
    if visited_toN[v]:return
    visited_toN[v] = True
    for nxt in ot[v]:
        dfs_r(nxt)
        
dfs(0)
dfs_r(N-1)
is_ok = []

for s, t in zip(visited_fm1,visited_toN):
    is_ok.append(s and t)


# BellmanFord    
INF = 10 ** 18
def bellmanFord(n, edges, s, g):
    """
    input
        n : 頂点の数
        edges : (始点, 終点, コスト)のリスト
        s : 探索の始点
        g : 探索の終点
    output
        sから各点への最短距離
    """    
    d = [INF] * n
    d[s] = 0
    cnt = 0
    while True:
        update = False
        for a, b, c in edges:
            if not is_ok[a]:continue
            if not is_ok[b]:continue
            if d[a] != INF and d[b] > d[a] + c:
                d[b] = d[a] + c
                update = True
        if not update:
            break
        cnt += 1
        # 負閉路の存在をチェック
        if cnt > n:
            print(-1)
            exit()
        # print(d,cnt)
    return d[g]



ans = bellmanFord(N,edges,0,N-1)
print(max(0,-ans))


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
from collections import defaultdict
edges = []
to = defaultdict(list) # 1から到達できるか
ot = defaultdict(list) # Nから到達できるか
N, M, P = map(int, input().split())
visited_toN = [False]*(N+1)
visited_fm1 = [False]*(N+1)    
for i in range(M):
    a,b,c = map(int, input().split())
    a -= 1
    b -= 1
    edges.append((a,b,-c+P))
    to[a].append(b)
    ot[b].append(a)

def dfs(v):
    global visited_fm1
    if visited_fm1[v]:return
    visited_fm1[v] = True
    for nxt in to[v]:
        dfs(nxt)
    
def dfs_r(v):
    global visited_toN
    if visited_toN[v]:return
    visited_toN[v] = True
    for nxt in ot[v]:
        dfs_r(nxt)
        
dfs(0)
dfs_r(N-1)
is_ok = []

for s, t in zip(visited_fm1,visited_toN):
    is_ok.append(s and t)


# BellmanFord    
INF = 10 ** 18
def bellmanFord(n, edges, s, g):
    """
    input
        n : 頂点の数
        edges : (始点, 終点, コスト)のリスト
        s : 探索の始点
        g : 探索の終点
    output
        sから各点への最短距離
    """    
    d = [INF] * n
    d[s] = 0
    cnt = 0
    while True:
        update = False
        for a, b, c in edges:
            if not is_ok[a]:continue
            if not is_ok[b]:continue
            if d[a] != INF and d[b] > d[a] + c:
                d[b] = d[a] + c
                update = True
        if not update:
            break
        cnt += 1
        # 負閉路の存在をチェック
        if cnt > n:
            print(-1)
            exit()
        # print(d,cnt)
    return d[g]



ans = bellmanFord(N,edges,0,N-1)
print(max(0,-ans))
N=int(input())
S=input()

for i in range(len(S)-2):
  while S[i]==S[i+1]:
    if S[i]==S[i+1]:
      S.remove(S[i])

print(len(S))

### FIXED CODE ###

N=int(input())
S=input()

for i in range(N-1):
  if S[i]==S[i+1]:
    N-=1

print(N)
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
import math
F = sys.stdin

N, M = list(map(int,F.readline().rstrip().split()))
a_list = list(map(int,F.readline().rstrip().split()))

num = 1
while a_list[0] % 2**(num + 1) == 0:
    num += 1
def lcm(a, b):
    return (a * b) // math.gcd(a, b)

lcm_before = 1
for a in a_list:
    if (a/(2**num)) % 2 != 1:
        print(0)
        sys.exit()

    lcm_before = lcm(lcm_before, a//2)



ans1 = M // lcm_before
ans = (ans1 + 1) // 2
print(ans)


### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
import fractions
F = sys.stdin

N, M = list(map(int,F.readline().rstrip().split()))
a_list = list(map(int,F.readline().rstrip().split()))

num = 1
while a_list[0] % 2**(num + 1) == 0:
    num += 1
def lcm(a, b):
    return (a * b) // fractions.gcd(a, b)

lcm_before = 1
for a in a_list:
    if (a/(2**num)) % 2 != 1:
        print(0)
        sys.exit()

    lcm_before = lcm(lcm_before, a//2)



ans1 = M // lcm_before
ans = (ans1 + 1) // 2
print(ans)
import sys
sys.setrecursionlimit(10000)

n, q = map(int, input().split())
tree = [[] for _ in range(n+1)]
for _ in range(n-1):
    a, b = map(int, input().split())
    tree[a].append(b)
adds = [0]*(n+1)
for _ in range(q):
    p, x = map(int, input().split())
    adds[p] += x

res = [0]*(n+1)
def add_x(p, x):
    res[p] += x
    for child in tree[p]:
        new_x = x+adds[child]
        add_x(child, new_x)

add_x(1, adds[1])

print(*res[1:])

### FIXED CODE ###

import sys
from heapq import *
sys.setrecursionlimit(10**8)

input = sys.stdin.readline

tree = [[] for _ in range(200001)]
res = [0]*200001

def dfs(p, pre):
    for child in tree[p]:
        if child == pre: continue
        res[child] += res[p]
        dfs(child, p)

def main():
    """ main """
    N, Q = map(int, input().split())
    for _ in range(N-1):
        a,b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    for _ in range(Q):
        p,x = map(int, input().split())
        res[p] += x
    dfs(1, 0)

    print(*res[1:N+1])

if __name__ == '__main__':
    main()
a=int(input())
print('8' if 400 <= a <= 599)
print('7' if 600 <= a <= 799)
print('6' if 800 <= a <= 999)
print('5' if 1000 <= a <= 1199)
print('4' if 1200 <= a <= 1399)
print('3' if 1400 <= a <= 1599)
print('2' if 1600 <= a <= 1799)
print('1' if 1800 <= a <= 1999)

### FIXED CODE ###

a=int(input())
if 400<=a<=599:
  print(8) 
if 600<=a<=799:
  print(7)
if 800<=a<=999:
  print(6)
if 1000<=a<=1199:
  print(5)
if 1200<=a<=1399:
  print(4)
if 1400<=a<=1599:
  print(3)
if 1600<=a<=1799:
  print(2)
if 1800<=a<=1999:
  print(1)
import bisect

  def calc():
  n,k=map(int,input().split())
  arr=list(map(int,input().split()))
  arr=sorted(arr)
  nc=0
  zc=0
  pc=0
  for i in range(n):
    if arr[i]<0:
      nc+=1
    elif arr[i]==0:
      zc+=1
    else:
      pc+=1
  ncc=nc*pc
  zcc=zc*(nc+pc)+(zc*(zc-1))//2
  pcc=(nc*(nc-1))//2+(pc*(pc-1))//2
  if k<=ncc:
    arr1=[]
    arr2=[]
    for i in range(n):
      if arr[i]<0:
        arr1.append(-arr[i])
      elif arr[i]>0:
        arr2.append(arr[i])
    arr1=arr1[::-1]
    c1=len(arr1)
    c2=len(arr2)
    k=ncc-k
    l=0
    r=10**18+1
    while r-l!=1:
      mid=(l+r)//2
      cnt=0
      for i in range(c1):
        cnt+=bisect.bisect_right(arr2,mid//arr1[i])
      if cnt>k:
        r=mid
      else:
        l=mid
    print(-r)
  elif k<=(ncc+zcc):
    print(0)
  else:
    arr1=[]
    arr2=[]
    for i in range(n):
      if arr[i]<0:
        arr1.append(-arr[i])
      elif arr[i]>0:
        arr2.append(arr[i])
    arr1=arr1[::-1]
    c1=len(arr1)
    c2=len(arr2)
    l=0
    r=10**18+1
    k-=(ncc+zcc)
    while r-l!=1:
      mid=(l+r)//2
      cnt1=0
      for i in range(c1):
        tmp=bisect.bisect_right(arr1,mid//arr1[i])
        if arr1[i]**2<mid:
          tmp-=1
        cnt1+=tmp
      cnt1=cnt1//2
      cnt2=0
      for i in range(c2):
        tmp=bisect.bisect_right(arr2,mid//arr2[i])
        if arr2[i]**2<mid:
          tmp-=1
        cnt2+=tmp
      cnt2=cnt2//2
      cnt=cnt1+cnt2
      if cnt>=k:
        r=mid
      else:
        l=mid
    print(r)
calc()

### FIXED CODE ###

#incited numpy source code from 'https://atcoder.jp/contests/abc155/submissions/10155744'

import numpy

n,k=map(int,input().split())
arr=list(map(int,input().split()))
nc=0
zc=0
pc=0
for i in range(n):
  if arr[i]<0:
    nc+=1
  elif arr[i]==0:
    zc+=1
  else:
    pc+=1
ncc=nc*pc
zcc=zc*(nc+pc)+(zc*(zc-1))//2
pcc=(nc*(nc-1))//2+(pc*(pc-1))//2
if ncc<k<=(ncc+zcc):
  print(0)
else:
  arr=numpy.array(arr,dtype=int)
  ms=numpy.msort(numpy.abs(arr[arr<0]))
  ps=numpy.msort(arr[arr>0])
  if k<=ncc:
    k=ncc-k
    l=0
    r=10**18+1
    while r-l!=1:
      mid=(l+r)//2
      cnt=numpy.searchsorted(ps,mid//ms,side='right')
      if cnt.sum()>k:
        r=mid
      else:
        l=mid
    print(-r)
  elif k<=(ncc+zcc):
    print(0)
  else:
    l=0
    r=10**18+1
    k-=(ncc+zcc)
    while r-l!=1:
      mid=(l+r)//2
      cnt1=numpy.searchsorted(ps,mid//ps,side='right')
      dup1=ps**2<=mid
      cnt2=numpy.searchsorted(ms,mid//ms,side='right')
      dup2=ms**2<=mid
      if (cnt1.sum()-dup1.sum()+cnt2.sum()-dup2.sum())//2>=k:
        r=mid
      else:
        l=mid
    print(r)
import math
r = raw_input()
print "%.4f %.4f" %(r*r*math.pi , r*2*math.pi)

### FIXED CODE ###

import math
r = input()
print '%.10f %.10f' %(r*r*math.pi , r*2*math.pi)
import sys
readline = sys.stdin.readline

MOD = 10**9+7
def frac(limit):
    frac = [1]*limit
    for i in range(2,limit):
        frac[i] = i * frac[i-1]%MOD
    fraci = [None]*limit
    fraci[-1] = pow(frac[-1], MOD -2, MOD)
    for i in range(-2, -limit-1, -1):
        fraci[i] = fraci[i+1] * (limit + i + 1) % MOD
    return frac, fraci
frac, fraci = frac(1341398)
def comb(a, b):
    if not a >= b >= 0:
        return 0
    return frac[a]*fraci[b]*fraci[a-b]%MOD

K = int(readline())
S = len(readline().strip())
ans = 0

M = 1341398
A = [1]*M
B = [1]*M
for i in range(1, M):
    A[i] = (A[i-1]*25)%MOD
    B[i] = (B[i-1]*26)%MOD

ans = 0

for i in range(K+1):
    ans = (ans+A[i]*B[K-i]*comb(i+S-1, i))%MOD

print(ans)



### FIXED CODE ###

import sys
readline = sys.stdin.readline

MOD = 10**9+7
def frac(limit):
    frac = [1]*limit
    for i in range(2,limit):
        frac[i] = i * frac[i-1]%MOD
    fraci = [None]*limit
    fraci[-1] = pow(frac[-1], MOD -2, MOD)
    for i in range(-2, -limit-1, -1):
        fraci[i] = fraci[i+1] * (limit + i + 1) % MOD
    return frac, fraci
frac, fraci = frac(2341398)
def comb(a, b):
    if not a >= b >= 0:
        return 0
    return frac[a]*fraci[b]*fraci[a-b]%MOD

K = int(readline())
S = len(readline().strip())
ans = 0

M = 1341398
A = [1]*M
B = [1]*M
for i in range(1, M):
    A[i] = (A[i-1]*25)%MOD
    B[i] = (B[i-1]*26)%MOD

ans = 0

for i in range(K+1):
    ans = (ans+A[i]*B[K-i]*comb(i+S-1, i))%MOD

print(ans)
import math

def main():
	a,b = map(int, input().split())
	num = math.gcd(a,b)
	if num == 1:
		print(1)
		exit()
	result_list = factorize(num)
	print(len(set(result_list)) + 1)			
	

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct


if __name__ == "__main__":
	main()


### FIXED CODE ###

from fractions import gcd
import math
a,b = map(int,input().split())
n = gcd(a,b)
if n == 1:
    print(1)
    exit()
count = 1
for i in range(2,math.ceil(math.sqrt(n))+1):
    if n % i == 0:
        count += 1
        while n % i == 0:
            n //= i
if n > 1:
    count += 1
print(count)