Harryxun/stf_run huggingface dataset:
n = int(input())
md = {'M':0, 'A':0 , 'R':0, 'C':0, 'H':0}
for _ in range(n):
    s = input()
    if s[0] in md:
        md[s[0]] += 1

vs = []
for v in md.values():
    vs.append(v)

ans = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            ans += vs[i]*vs[j]*vs[k]

print(ans)

### FIXED CODE ###

n = int(input())
md = {'M':0, 'A':0 , 'R':0, 'C':0, 'H':0}
for _ in range(n):
    s = input()
    if s[0] in md:
        md[s[0]] += 1

vs = []
for v in md.values():
    vs.append(v)

ans = 0
for i in range(5):
    for j in range(i+1,5):
        for k in range(j+1,5):
            ans += vs[i]*vs[j]*vs[k]

print(ans)
n1 = int(input())
n2 = int(input())

if n1 >= 3200:
    print(n2)
else:
    print("red")

### FIXED CODE ###

n1 = int(input())
n2 = str(input())

if n1 >= 3200:
    print(n2)
else:
    print("red")
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('integers', metavar='N', type=int, nargs='+',
               help='an integer for the accumulator')

args = parser.parse_args()

if args[0] == args[1]: 
    print(-1)
elif args[0] < 0 or args[1] < 0: 
    print (-1)
else:
    for i in range(1, 10 ** 10 / args[0]):
        if args[0] * i % args[1] == 0:
            print args[0] * i
            break
print(-1)



### FIXED CODE ###

a, b = (int(i) for i in input().split())  

if a == b: 
    print(-1)
elif a < 0 or b < 0: 
    print (-1)
else:
    for i in range(1, int(10 ** 10 / a)):
        if a * i % b != 0:
            print(a * i)
            exit()
        else:
            continue
    print(-1)
a, b = map(int, input().split())

d = a*b
c = a*2 + b*2

print(d +" " +c)


### FIXED CODE ###

c= input()
a, b = map(int, c.split())
print(str(a*b) +" "+str(a*2 + b*2))
N=int(input())
h=[int(i) for i in input().split()]
def cost(n):
    if n == 0:
        return 0
    elif n == 1:
        return abs(h[1]-h[0])
    else:
        return min(cost(n-2)+abs(h[n]-h[n-2]), cost(n-1)+abs(h[n]-h[n-1]))
print(cost(N-1))

### FIXED CODE ###

N=int(input())
h=[int(i) for i in input().split()]
cost = [-1]*N
cost[0]=0
cost[1]=abs(h[1]-h[0])
for i in range(2,N):
    cost[i] = min(cost[i-2]+abs(h[i]-h[i-2]), cost[i-1]+abs(h[i]-h[i-1]))
print(cost[-1])
a, b = [int(x) for x in input().split()]

as = str(a) * b
bs = str(b) * a

print(as if as < b else bs)

### FIXED CODE ###

a, b = [int(x) for x in input().split()]

As = str(a) * b
Bs = str(b) * a

print(min(As, Bs))
N = 1000001
 
spf = [*range(N)]
i = 2
while i * i < N:
  if spf[i] == i:
    for j in range(i * i, N, i):
      if spf[j] == j:
        spf[j] = i
  i += 1
  
r = 'pairwise'
input()
u = set()
i = None
a = [int(x) for x in input().split() if x > '1']
if len(a) > 1:
  for x in :
    s = set()
    while x > 1:
      p = spf[x]
      if p in u:
        r = 'setwise'
      s.add(p)
      x //= p
    u |= s
    i = (i or s) & s
  if i:
    r = 'not'
print(r, 'coprime')


### FIXED CODE ###

N = 1000001
 
spf = [*range(N)]
i = 2
while i * i < N:
  if spf[i] == i:
    for j in range(i * i, N, i):
      if spf[j] == j:
        spf[j] = i
  i += 1
  
r = 'pairwise'
n = int(input())
a = [int(x) for x in input().split() if x > '1']
if len(a) > 1:
  u = set()
  i = None
  for x in a:
    s = set()
    while x > 1:
      p = spf[x]
      if p in u:
        r = 'setwise'
      s.add(p)
      x //= p
    u |= s
    if len(a) == n:
      if i is None: i = s
      else: i &= s
  if i:
    r = 'not'
print(r, 'coprime')
N = int (input ())
l = []
for i in range (N):
    a = int (input ())
    l.append (a)
list.sort (l, reverse=True)
a = 0
x = 0
for i in range (round(N/2)):
    x += l[a]
    a += 2
a = 1
y = 0
for i in range (N-(round(N/2))):
    y += l[a]
    a += 2
print (x-y)

### FIXED CODE ###

N = int (input ())
L = input ().split ()
l = [int(s) for s in L]
list.sort (l, reverse=True)
a = 0
x = 0
y = 0
while True:
    x += int (l[a])
    a += 1
    if a == N:
        break
    y += int (l[a])
    a += 1
    if a == N:
        break
print (x-y)
#!/usr/bin/env python3

import networkx as nx
from networkx.algorithms import bipartite
import numpy as np
import itertools
import matplotlib.pyplot as plt


n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
cd = [list(map(int, input().split())) for i in range(n)]


match_list = [[] for i in range(n)]
for i in range(n):
    for j in range(n):
        a, b = ab[i]
        c, d = cd[j]

        if a < c and b < d:
            match_list[i].append(j)
# print(match_list)


group1 = range(n)
group2 = range(n, 2*n)

g = nx.Graph()
g.add_nodes_from(group1, bipartite=1)
g.add_nodes_from(group2, bipartite=0)

for i, list_ in enumerate(match_list):
    for j in list_:
        g.add_edge(i, j+n, weight=1)

# A, B = bipartite.sets(g)
# print(A, B)
# pos = dict()
# pos.update((n, (1, i)) for i, n in enumerate(A))
# pos.update((n, (2, i)) for i, n in enumerate(B))
# nx.draw_networkx(g, pos)
# nx.draw_networkx_edges(g, pos)
# plt.axis("off")
# plt.show()


d = nx.max_weight_matching(g)

print(len(d))


### FIXED CODE ###

#!/usr/bin/env python3

import networkx as nx


n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
cd = [list(map(int, input().split())) for i in range(n)]


match_list = [[] for i in range(n)]
for i in range(n):
    for j in range(n):
        a, b = ab[i]
        c, d = cd[j]

        if a < c and b < d:
            match_list[i].append(j)
# print(match_list)


group1 = range(n)
group2 = range(n, 2*n)

g = nx.Graph()
g.add_nodes_from(group1, bipartite=1)
g.add_nodes_from(group2, bipartite=0)

for i, list_ in enumerate(match_list):
    for j in list_:
        g.add_edge(i, j+n, weight=1)

# A, B = bipartite.sets(g)
# print(A, B)
# pos = dict()
# pos.update((n, (1, i)) for i, n in enumerate(A))
# pos.update((n, (2, i)) for i, n in enumerate(B))
# nx.draw_networkx(g, pos)
# nx.draw_networkx_edges(g, pos)
# plt.axis("off")
# plt.show()


d = nx.max_weight_matching(g)

print(len(d))
a,b=(int(x) for x in input().split())

if a//2==0 and b//2==0:
  print(“YES”)

else:
  (“NO”)

### FIXED CODE ###

a,b = (int(x) for x in input().split())

if a%2==1 and b%2==1 :
    print("Yes")

else :
    print("No")
n = int(input())
money = 0
for i in range(n):
	x,u = input().split()
	if u = 'JPY':
		money += int(x)
	else:
		money += int(x)*10000
print(money)

### FIXED CODE ###

n = int(input())
money = 0
for i in range(n):
	x,u = input().split()
	if u == 'JPY':
		money += int(x)
	else:
		money += float(x)*380000.0
 
print(money)
from math import pi
def cicle(hankei):
    return 2 * hankei * pi

circle(1)
circle(73)

### FIXED CODE ###

from math import pi

r = input()
print(2 * int(r) * pi)
n, m = map(int, input().split())
q = []
for i in range(m):
    a, b = map(int, input().split())
    q.append({a, b})
cnt = 0
array = list(range(1, m+1))
while cnt != 10000:
    a = q.pop()
    for j in q:
        if len(j & a) != 0:  # jとaに共通の値があるならば
            j |= a
            count = 0
            break
        else:  # jとaに共通の値がなければ
            q = [a] + q
    if count > len(q):
        break
    count += 1
    for i in q:
        tmp = list(i)
        if tmp == array:
            cnt += 1
print(cnt)


### FIXED CODE ###

N, M = map(int, input().split())

path_matrix = []

#無向行列の初期化
for n in range(N):
    path_matrix.append([False] * N)

#まず無向グラフを表す行列を作る
for m in range(M):
    a,b = map(int, input().split())
    path_matrix[a-1][b-1] = True
    path_matrix[b-1][a-1] = True
#無向グラフを表す行列はpath_matrix[i][j]iの部分が各頂点でjが他の頂点との繋がりを意味する
#最初はvisited、つまり訪問したことのあるノードはひとつもないので、Falseにする
visited = [False] * N #この問題は各頂点をすべて通る方法を調べること
def dfs(now,depth):
    if visited[now]:#もし現在位置が訪問済みなら
        return 0
    if depth == N-1:#もし深さが最大までいったらすべての頂点を探索し終えたので１を返す
        return 1
    
    visited[now] = True#現在位置を訪問済みにする(これをしないとループし続ける)
    total_path = 0
    for i in range(N):
        if path_matrix[now][i]:#もし飛べる先があるのなら、その飛んだ先のノードで今いる位置と深さを更新した上で、もっと掘り下げてみる
            total_path += dfs(i,depth+1)#もし深さが最大まで行ったらすべての頂点について探索が終了したので1加える

    visited[now] = False

    return total_path


print(dfs(0,0))
import math
import copy
from copy import deepcopy
import sys
import fractions
import numpy as np
from functools import reduce
import statistics
import heapq


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

data = getInputListInt()
N = data[0]
K = data[1]
MOD = 1000000000 + 7

# nCa
def choose(n, a):
    if n < a: return 0
    if n == 0 or a == 0: return 1
    if a < 1: return 0
    x = 1
    y = 1
    for i in range(a):
        x *= n-i
        y *= i+1
    return int(x / y)

def f2(n, k):
    return choose(n+k-1, k-1)

def f(n, k):
    if (n < k): return 0
    if(n == 0 and k == 0): return 1
    if(k < 1): return 0
    return f2(n-k, k)

for i in range(1, K+1, 1):
    blue = f(K, i)
    red = f2(N-K-(i-1), i+1)

    ans = (blue * red) % MOD
    print(int(ans))


### FIXED CODE ###

import sys

# import re
import math
import collections
# import decimal
# import bisect
# import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    def fast_pow(num, kata, mod):
        if kata == 0:
            return 0

        res = 1
        while kata > 0:
            if kata & 1 == 1:
                res = res * num % mod
            num = num * num % mod

            kata >>= 1
        return res

    # MODのCombination nがでかくても関係なくrに依存　r<10**6なら回せる
    MOD = 10 ** 9 + 7

    def choose(n, r):
        res = 1
        fac = 1
        for i in range(r):
            res *= n - i
            res %= MOD
            fac *= i + 1
            fac %= MOD
        return res * fast_pow(fac, MOD - 2, MOD) % MOD

    n, k = ns()

    for i in range(1, k + 1):
        blue_pair = choose(k - i + (i - 1), i - 1)
        red_pair = choose((n - k) + 1, i)
        print(blue_pair * red_pair % MOD)


if __name__ == '__main__':
    main()
n, x = map(int, input().split())
l = list(map(int, input().split()))

count = 0
sum = 0

while sum <= x or count == len(l) + 1:
  sum += l[count]
  count+=1
print(count)

### FIXED CODE ###

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

count = 0
sum = 0

for i in range(len(l)):
  sum += l[i]
  if sum <= x:
    count+=1
print(count + 1)
class Factorial():
    def __init__(self, n, mod):
        self.mod = mod
        self.fct = [0 for _ in range(n + 1)]
        self.inv = [0 for _ in range(n + 1)]
        self.fct[0] = 1
        self.inv[0] = 1
        for i in range(n):
            self.fct[i + 1] = self.fct[i] * (i + 1) % mod
        self.inv[n] = pow(self.fct[n], mod - 2, mod)
        for i in range(n)[::-1]:
            self.inv[i] = self.inv[i + 1] * (i + 1) % mod

    def comb(self, m, k):
        if m < k: return 0
        return self.fct[m] * self.inv[k] * self.inv[m - k] % self.mod

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

f = Factorial(N, MOD)

res = 0

for i in range(N + 1):
    if (K - A * i) % B == 0:
        j = (K - A * i) // B
        res += f.comb(N, i) * f.comb(N, j)
        res %= MOD
        
print(res)

### FIXED CODE ###

class Factorial():
    def __init__(self, n, mod):
        self.mod = mod
        self.fct = [0 for _ in range(n + 1)]
        self.inv = [0 for _ in range(n + 1)]
        self.fct[0] = 1
        self.inv[0] = 1
        for i in range(n):
            self.fct[i + 1] = self.fct[i] * (i + 1) % mod
        self.inv[n] = pow(self.fct[n], mod - 2, mod)
        for i in range(n)[::-1]:
            self.inv[i] = self.inv[i + 1] * (i + 1) % mod

    def comb(self, m, k):
        if m < k: return 0
        return self.fct[m] * self.inv[k] * self.inv[m - k] % self.mod

def ex_euclid(x, y):
    c0, c1 = x, y
    a0, a1 = 1, 0
    b0, b1 = 0, 1
    while c1:
        a0, a1 = a1, a0 - c0 // c1 * a1
        b0, b1 = b1, b0 - c0 // c1 * b1
        c0, c1 = c1, c0 % c1
    return c0, a0, b0

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

f = Factorial(N, MOD)
c, a, b = ex_euclid(A, B)

if K == 0:
    print(1)

elif K % c != 0:
    print(0)

else:
    lo = -10**18
    hi = 10**18
    while hi - lo > 1:
        mid = (hi + lo) // 2
        if a * K // c + mid * B // c >= 0:
            hi = mid
        else:
            lo = mid
    x0 = a * K // c + hi * B // c

    lo = -10**18
    hi = 10**18
    while hi - lo > 1:
        mid = (hi + lo) // 2
        if b * K // c - mid * A // c >= 0:
            lo = mid
        else:
            hi = mid
    y0 = b * K // c - lo * A // c

    res = 0
    x = x0
    y = (K - A * x0) // B

    while True:
        res += f.comb(N, x) * f.comb(N, y)
        res %= MOD
        if y == y0:
            break
        x += B // c
        y -= A // c

    print(res)
import os, sys, re, math

N,M = list(map(int,input().split(' ')))
A = list(map(int,input().split(' ')))
print(A)

match = [-1,2,5,5,4,5,6,3,7,6]
memo = {}

def doit(m):
    if m in memo:
        return memo[m]

    max_v = '-9'
    for a in A:
        if m - match[a] == 0:
            max_v = max(max_v, str(a), key=lambda x: int(x))
        elif m - match[a] >= 0:
            max_v = max(max_v, doit(m - match[a]) + str(a), key=lambda x: int(x))
    if max_v != '':
        memo[m] = str(max_v)
        return str(max_v)
    else:
        return '-9'

print(doit(N))


### FIXED CODE ###

import os, sys, re, math
sys.setrecursionlimit(100000)
N,M = list(map(int,input().split(' ')))
A = list(map(int,input().split(' ')))

match = [100,2,5,5,4,5,6,3,7,6]
memo = {}

def doit(m):
    if m in memo:
        return memo[m]
    if m == 0:
        return ""

    ret = None
    for a in A:
        tmp = None
        if m - match[a] >= 0:
            tmp = doit(m - match[a])
            if tmp is not None:
                tmp = str(a) + tmp
                if ret is not None:
                    if len(ret) < len(tmp) or (len(ret) == len(tmp) and tmp > ret):
                        ret = tmp
                else:
                    ret = tmp

    memo[m] = ret
    return ret

print(doit(N))
import numpy
h,w=map(int,input().split())
a = []
for i in range(h):
  l = input()
  l = list(l)
  a.append(l)

L = []
R = []
for i in range(h):
  l = []
  r = []
  k = 0
  m = 0
  for j in range(w):
    if a[i][w-j-1] == ".":
      k += 1
    else:
      k = 0
    if a[i][j] == ".":
      m += 1
    else:
      m = 0
    r.insert(0,k)
    l.append(m)
  R.append(r)
  L.append(l)

D = []
U = []
for i in range(h):
  D.append([])
  U.append([])
for i in range(w):
  k = 0
  m = 0
  for j in range(h):
    if a[j][i] == ".":
      k += 1
    else:
      k = 0
    if a[h-j-1][i] == ".":
      m += 1
    else:
      m = 0
    U[j].append(k)
    D[h-j-1].append(m)
A = numpy.array(L)+numpy.array(R)+numpy.array(U)+numpy.array(D)
print(max(numpy.amax(A-3),0))

### FIXED CODE ###

import numpy as np
h,w = map(int,input().split())
s = np.array([[1 if i == "." else 0 for i in input()] for j in range(h)])
l,r,u,d = np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w))
for i in range(h):
  u[i] = (u[i-1]+1)*s[i]
  d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(w):
  l[:,i] = (l[:,i-1]+1)*s[:,i]
  r[:,-i-1] = (r[:,-i]+1)*s[:,-i-1]
print(int(np.max(l+r+u+d))-3)
import math

m = int(input())
dc = []

sum_c = 0
before_num = 0
add_two = 0
kuriage = 0

for i in range(m):
  array = list( map(int, input().split()) )
  dc.append(array)
  sum_c += int(dc[i][1])
  
cnt = sum_c - 1

for i in range(m):
  add_two += int(dc[i][0]) * int(dc[i][1])
  if add_two % 9 == 0:
    cnt += add_to // 9 - 1
    add_two = 9
  else:
    cnt += add_two // 9
    add_two = add_two % 9

print(cnt)

### FIXED CODE ###

#https://atcoder.jp/contests/ddcc2020-qual/submissions/8587774

M = int(input())
dc = [list(map(int, input().split())) for _ in range(M)]
 
d = [dc[i][0] for i in range(M)]
c = [dc[i][1] for i in range(M)]
 
ans = sum(c) - 1
s = 0
 
for i in range(M):
    s += c[i] * d[i]
    if s % 9 != 0:
        ans += s // 9
        s = s % 9
    else:
        ans += s//9 - 1 
        s = 9
print(ans)
cases = 1
while True :
    num = raw_input ( )
    if int ( num ) == 0 :
        break
    print "Case %d: %d" % ( cases , num )
    cases += 1
    

### FIXED CODE ###

cases = 1
while True :
    num = raw_input ( )
    if int ( num ) == 0 :
        break
    print "Case %d: %d" % ( int ( cases ) , int ( num ) )
    cases += 1
a,b,c,d,e,f=map(int,input().split())
l=[]
for i in range(0,f//(100*a)+1):
  for j in range(0,f//(100*b)+1):
    if 100*a*i+100*b*j>=f:
      pass
    else:
      l.append(100*a*i+100*b*j)
l1=[]
del l[0]
max1=0
g=0
h=0
for i in l:
  l2=[]
  m=min(f-i,(i//100)*e)
  max2=0
  for j in range(0,m//c+1):
    for k in range(0,m//d+1):
      if j*c+k*d<=m and j*c+k*d>max2:
        max2=j*c+k*d
  if max1<100*max2/(i+max2):
    g=i
    f=max2
    max1=100*max2/(i+max2)
print(i+max2,max2)


### FIXED CODE ###

i=int(input())
s=int(input())
print(i*i-s)
n = int(input())
m = list(map(int,input().split()))
o = []
for i in m:
  o.append(1/a[i])
p = sum(o) 
print(1/p)

### FIXED CODE ###

n = int(input())
m = list(map(int,input().split()))
o = []
c  = 0
for i in m:
  o.append(1/m[c])
  c += 1
s = sum(o)
print(1/s)
import math
k = input()
s, t = [int(i)/k for i in input().split()]

if math.ceil(s) <= math.floor(t):
  print('OK')
else:
  print('NG')

### FIXED CODE ###

import math
k = int(input())
s, t = [int(i)/k for i in input().split()]

if math.ceil(s) <= math.floor(t):
  print('OK')
else:
  print('NG')
import heapq
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(N)]

AB.sort(reverse=True)
works=[]
heapq.heapify(works)
ans=0
AB.append([0,0])
for i in range(1,M+1):
  day=M-i
  latest=i
  while AB and AB[-2][0]<=latest:
    a,b=AB.pop(-2)
    heapq.heappush(works,-b)
  if not works:
    continue
  ans-=heapq.heappop(works)

print(ans)


### FIXED CODE ###

import heapq
N,M=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(N)]

AB.sort(reverse=True)
works=[]
heapq.heapify(works)
ans=0
for i in range(1,M+1):
  day=M-i
  latest=i
  while AB and AB[-1][0]<=latest:
    a,b=AB.pop()
    heapq.heappush(works,-b)
  if not works:
    continue
  ans-=heapq.heappop(works)

print(ans)
n = int(input())

if n % 4 == 0 or n % 7 == 0
    print('Yes')

elif (n % 7) % 4 == 0:
    print('Yes')

else:
    print('No')

### FIXED CODE ###

n = int(input())

ans = []
for i in range(n//4+1):
    for j in range(n//7+1):
        if 4*i+7*j <= n:
            ans.append(4*i+7*j)
if ans.count(n) != 0:
    print('Yes')
else:
    print('No')
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")


a, b, c = list(map(int, sys.stdin.readline().split()))
if a==b==c:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")


a, b, c = list(map(int, sys.stdin.readline().split()))
if a==b==c:
    print('Yes')
else:
    print('No')
# -*- coding: utf-8 -*-

A, B, C, D = int(raw_input())
if A*B >= C*D:
    print A*B
else:
    print C*D



### FIXED CODE ###

# -*- coding: utf-8 -*-

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

if A*B >= C*D:
    print(A*B)
else:
    print(C*D)
n, m = map(int, input().split())

for i in range(1, int(m**0.5)+1)[::-1]:
    if (m % i == 0):
        if m / i >= n:
            ans = max(ans, i)
        if i >= n:
            ans = max(ans, m // i)
print(ans)


### FIXED CODE ###

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

ans = 0
for i in range(1, int(m ** 0.5) + 1)[::-1]:
    if (m % i == 0):
        if m / i >= n:
            ans = max(ans, i)
        if i >= n:
            ans = max(ans, m // i)
print(ans)
def tri_len(x,y):
  if x== y:
    return x
  elif x < y:
    return tri_len(y-x,x)+2*x
  else:
    return tri_len(x-y,y)+2*y
import sys
sys.setrecursionlimit(100000)

n,x= list(map(int,input().split(" ")))

print( n+tri_len(x,n-x))

### FIXED CODE ###

a = input()
lst = list(map(int,input().split(" ")))
lst.sort()
ans=0
for i in range(int(len(lst)/2)):
  ans += lst[len(lst)-2*i-2]
 
print(ans)
import math
N = int(input())

def order2(x):
  if x > 0 :
    k = 0
    check = 0
    while check == 0 :
      s = 0
      for i in range(0, k+1, 2):
        s += (-2)**i
        ans = i
      if s >= x:
        check = 1
      k += 2
  elif x < 0 :
    k = 1
    check = 0
    while check == 0 :
      s = 0
      for i in range(1, k+1, 2):
        s += (-2)**i
        ans = i
      if s <= x:
        check = 1
      k += 2
  return ans

if N!= 0 :


  l = [] 
  a = N
  i = order2(N)
  while i >= 0:
    if a == 0 :
      l.append(0)
    if a > 0 and (-2)**i >0 :
        s = 0
        for j in range(0, i, 2):
          s += (-2)**j
        print(a,s)
        if a > s :
          l.append('1')
          a -= (-2)**i
        else :
          l.append('0')
    elif a > 0 and (-2)**i < 0:
        l.append('0')
    elif a < 0 and (-2)**i > 0:
        l.append('0')
    elif a < 0 and (-2)**i < 0:
        s = 0
        for j in range(1, i, 2):
          s += (-2)**j
        if a < s :
          l.append('1')
          a -= (-2)**i
        else :
          l.append('0')
    i -= 1

  print(''.join(l))

else :
  print(0)

### FIXED CODE ###

N = int(input())

def order2(x):
  if x > 0 :
    k = 0
    check = 0
    while check == 0 :
      s = 0
      for i in range(0, k+1, 2):
        s += (-2)**i
        ans = i
      if s >= x:
        check = 1
      k += 2
  elif x < 0 :
    k = 1
    check = 0
    while check == 0 :
      s = 0
      for i in range(1, k+1, 2):
        s += (-2)**i
        ans = i
      if s <= x:
        check = 1
      k += 2
  return ans

if N!= 0 :


  l = [] 
  a = N
  i = order2(N)
  while i >= 0:
    if a == 0 :
      l.append('0')
    if a > 0 and (-2)**i >0 :
        s = 0
        for j in range(0, i, 2):
          s += (-2)**j
        if a > s :
          l.append('1')
          a -= (-2)**i
        else :
          l.append('0')
    elif a > 0 and (-2)**i < 0:
        l.append('0')
    elif a < 0 and (-2)**i > 0:
        l.append('0')
    elif a < 0 and (-2)**i < 0:
        s = 0
        for j in range(1, i, 2):
          s += (-2)**j
        if a < s :
          l.append('1')
          a -= (-2)**i
        else :
          l.append('0')
    i -= 1

  print(''.join(l))

else :
  print(0)
N,M,C = map(int,input().split())
B = list(int,input().split())
count = -
for i in range(N):
  a = list(int,input().split())
  for i in range(M)
  if sum(B[i]*a[i])+C>0:
    count+=1
print(count)

### FIXED CODE ###

N,M,C = map(int,input().split())
B = list(map(int,input().split()))
count = 0
for i in range(N):
  a = list(map(int,input().split()))
  P = C  
  for j in range(M):
    P += B[j]*a[j]
  if P>0:
    count+=1
print(count)