Harryxun/stf_run huggingface dataset:
def factorize(n):
    if n == 1:
        return [1]
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

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

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

f = factorize(p)
cnt = [0] * (max(f) + 1)

for _f in f:
    cnt[_f] += 1

ans = 1
# print(cnt)

for i in range(len(cnt)):
    if cnt[i] >= n:
        ans *= i

print(ans)

### FIXED CODE ###

import math
# 素因数分解
def factorize(n):
    if n == 1:
        return [1]
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def f(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# 素数判定
def isPrime(n):
    if n == 1:
        return False
    else:
        for i in range(2, int(math.sqrt(n)) + 1):
           if n%i == 0:
               return False
        return True


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

if n == 1 or isPrime(p):
    print(p)
    exit()

# f = factorize(p)
# cnt = [0] * (max(f) + 1)
# # print(f)

# for _f in f:
#     cnt[_f] += 1

# ans = 1
# # print(cnt)

# for i in range(len(cnt)):
#     if cnt[i] >= n:
#         loop = cnt[i]//n
#         for j in range(loop):
#             ans *= i

# print(ans)

f = f(p)
ans = 1

for i in range(len(f)):
    ans *= f[i][0] ** (f[i][1] // n)

print(ans)
from bisect import bisect_right
def getVal(i):  # get value of node (i,i)
    v = T[(i,i)][0]
    cur = (i,i)
    cur = T[cur][1]
    while cur[0]>=0:
        v += T[cur][0]
        cur = T[cur][1]
    return v
def udT(i,j,x,node):  # add x between [i,j] where current node is given
    l,r = node[0],node[1]
    if i<=l and r<=j:
        T[node][0] += x
    elif i>r or j<l:
        return
    else:
        udT(i,j,x,T[node][2])
        udT(i,j,x,T[node][3])
N,D,A = map(int,input().split())
X = sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0])
n = 0
m = N
while m>0:
    m = m//2
    n += 1
if N==2**(n-1):
    n -= 1
for i in range(N,2**n):  # fill in the remainder of N
    X.append([X[-1][0]+1,0])
# Construction of Tree
Y = [X[i][0] for i in range(N)]  # Tree structure
T = {(i,i):[X[i][1],(i,i+1) if i%2==0 else (i-1,i),(-1,-1),(-1,-1)] for i in range(2**n)}  # T[node] = [value,parent,left_child,right_child]
for h in range(n):
    for i in range(2**h):
        d = 2**(n-h)  # interval length of each node
        if h==0:
            T[(i*d,(i+1)*d-1)] = [0,(-1,-1),(i*d,i*d+d//2-1),((i+1)*d-d//2,(i+1)*d-1)]
        else:
            T[(i*d,(i+1)*d-1)] = [0,(i*d,i*d+2*d-1) if (i*d)%2**(n-h+1)==0 else ((i+1)*d-2*d,(i+1)*d-1),(i*d,i*d+d//2-1),((i+1)*d-d//2,(i+1)*d-1)]
cnt = 0
cur = 0
while cur<N:
    x = Y[cur]
    v = getVal(cur)
    if v%A==0:
        k = v//A
    else:
        k = v//A+1
    ind = bisect_right(Y,x+2*D)
    udT(cur,ind-1,-k*A,(0,2**n-1))
    cnt += k
    flag = 0
    for i in range(cur+1,N):
        if getVal(i)>0:
            cur = i
            flag = 1
            break
    if flag==0:
        cur = N
print(cnt)

### FIXED CODE ###

from bisect import bisect_right
N,D,A = map(int,input().split())
X = sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0])
B = [0 for _ in range(N+1)]
cnt = 0
cur = 0
delta = 0
flag = 0
while cur<N:
    x = X[cur][0]
    h = X[cur][1]+delta
    if h%A==0:
        n = h//A
    else:
        n = h//A+1
    ind = bisect_right(X,[x+2*D,10**9+1])
    B[cur] += -n*A
    B[ind] += n*A
    cnt += n
    flag = 0
    for i in range(cur,N):
        delta += B[i]
        B[i] = 0
        if X[i][1]+delta>0:
            cur = i
            flag = 1
            break
    if flag==0:
        cur = N
print(cnt)
n,k=map(int,input().split())


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

ar=[-1 for i in range(n+1)]
p=1

go=0


for i in range(1,k+1):
    
    
    
    

    ar[p]=i
    p=a[p-1]
    
    if ar[p]>0:
        j=ar[p]
        amari=(k-i-1)%(i-j)
        
        go=1
        break

if go==1:
    p=ar.index(j+amari)
    p=a[p-1]
    


print(p)


### FIXED CODE ###

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


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

ar=[-1 for i in range(n+1)]
p=1

go=0


for i in range(1,k+1):
    
    
    
    

    ar[p]=i-1
    p=a[p-1]
    
    if ar[p]>0:
        j=ar[p]
        amari=(k-i)%(i-j)
        
        go=1
        break

if go==1:
    p=ar.index(j+amari)
    
    


print(p)
n = int(input())
s = input()

ans = 0

for i in range(n):
    ans = max(ans, len(set[:i] & set[i:]))
print(ans)

### FIXED CODE ###

n = int(input())
s = input()
l = []
for i in range(1, n):
    cnt = 0
    for j in set(s[:i]):
        if j in list(s[i:]):
            cnt += 1
    l.append(cnt)
print(max(l))
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def lcm(a, b):
	return a * b // gcd (a, b)
n, m = map(int,input().split())
s = input()
t = input()
j = 0
a = gcd(n, m)
for i, c in enumerate(s):
	if i % a == 0:
		if c != t[i // a * m]:
			j = -1
			break
if j >= 0:
	j = lcm(n, m)
print(j)

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def lcm(a, b):
	return a * b // gcd (a, b)
n, m = map(int,input().split())
s = input()
t = input()
j = 0
a = gcd(n, m)
for i, c in enumerate(s):
	if i % (n // a) == 0:
		if c != t[(i // (n // a)) * (m // a)]:
			j = -1
			break
if j >= 0:
	j = lcm(n, m)
print(j)
s = input()
a = False
b = False
c = False
cnt = 0
k = 0

if s[0] == 'A':
	a = True

for c in range(s[2],s[-1]):
	if c == 'C':
		cnt += 1
if cnt == 1:
	b = True

for c in s:
	if c != 'A' or c != 'C':
		if c.islower() == True:
			k += 1

if k == len(s):
	c = True


if a == b == c == True:
	print("AC")
else:
	print("WC")


### FIXED CODE ###

r = int(input())

if r < 1200:
	print("ABC")
elif r < 2800:
	print("ARC")
else:
	print("AGC")
a, b, x = map(int, input())
print(a * (b - 1) // b)

### FIXED CODE ###

a, b, n = map(int, input().split())
print(a * min(n, b - 1) // b)
n, m, k = map(int, input().split())
clusterN = [1] * n
clusterI = list(range(n))
out = [0] * n
def generateC(x):
  if clusterI[x] != x:
    minI = generateC(clusterI[x])
    clusterI[x] = minI
    return minI
  else:
    return x

def unite(x, y):
  CX = clusterI[x]
  CY = clusterI[y]
  if CX != CY:
    if clusterI[CX] > clusterI[CY]:
      CX, CY = CY, CX
    clusterN[CX] += clusterN[CY]
    clusterI[CY] = CX
    generateC(y)
    generateC(x)
    

for _ in range(m):
  a, b = map(int, input().split())

  unite(a-1, b-1)
  out[a-1] -= 1
  out[b-1] -= 1

for _ in range(k):

  a, b = map(int, input().split())
  if clusterI[a-1] == clusterI[b-1]:
    out[a-1] -= 1
    out[b-1] -= 1
out = [out[i] + clusterN[clusterI[i]] - 1 for i in range(n)]
print(*out)

### FIXED CODE ###

n, m, k = map(int, input().split())
clusterN = [1] * n
clusterI = list(range(n))
out = [0] * n
def generateC(x):
  if clusterI[x] != x:
    minI = generateC(clusterI[x])
    clusterI[x] = minI
    return minI
  else:
    return x

def unite(x, y):
  CX = generateC(x)
  CY = generateC(y)
  if CX != CY:
    if CX > CY:
      CX, CY = CY, CX
      x, y = y, x
    clusterN[CX] += clusterN[CY]
    clusterI[CY] = CX
    generateC(y)
    

for _ in range(m):
  a, b = map(int, input().split())

  unite(a-1, b-1)
  out[a-1] -= 1
  out[b-1] -= 1

for _ in range(k):

  a, b = map(int, input().split())
  if generateC(a-1) == generateC(b-1):
    out[a-1] -= 1
    out[b-1] -= 1
out = [out[i] + clusterN[generateC(i)] - 1 for i in range(n)]
print(*out)
n, q = [int(x) for x in input().split(' ')]
s = input()
lr = [[int(x) for x in input().split(' ')] for _ in range(q)]

indexes = []
for i in range(1, len(s)):
    if s[i-1] == 'A' and s[i] == 'C':
        indexes.append([i-1, i])

print('\n'.join([len([x for x in indexes if l-1 <= x[0] and x[1] <= r-1]) for l, r in lr]))


### FIXED CODE ###

n, q = [int(x) for x in input().split(' ')]
s = input()
lr = [[int(x) for x in input().split(' ')] for _ in range(q)]


indexes = [0] * n

for i in range(1, len(s)):
    if s[i-1] == 'A' and s[i] == 'C':
        indexes[i] = indexes[i-1]+1
    else:
        indexes[i] = indexes[i-1]

for l, r in lr:
    print(indexes[r-1]-indexes[l-1])
t = str(input())

p_num = t.count("P")
d_num = t.count("D")
h_num = t.count("?")

if p_num<d_num:
  p_num += h_num
else :
  d_num += h_num
  
if p_num>d_num:
  swap(p_num, d_num)
  
for i in range(p_num):
  print("PD", end='')

for i in range(d_num-p_num):
  print("D", end='')
print()


### FIXED CODE ###

t = input()

t = t.replace('?', 'D')
print(t)
start = input().split()
n = int(start[0])
d = int(start[1])

c = 0

for i in ramge(n):
    middle = input().split()
    x = int(start[0])
    y = int(start[1])
    if x**2 + y**2 <= d**2:
        c+=0

print(c)
        
        
    

### FIXED CODE ###

st = input().split()
n = int(st[0])
d = int(st[1])

c = 0

for i in range(n):
    middle = input().split()
    x = int(middle[0])
    y = int(middle[1])
    if x**2 + y**2 <= d**2:
        c+=1

print(c)
A, B = map( int, input().split())

C1 = A + B
C2 = A - B
C3 = A * B

C = [ C1, C2, C3 ]

C = sorted.C

print(C[2])



### FIXED CODE ###

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

C1 = A + B
C.append(C1)

C2 = A - B
C.append(C2)

C3 = A * B
C.append(C3)

C = sorted(C)

print(C[2])
K, A, B = map(int, input().split())
if 0 <= A + 2 - B
  print(K + 1)
else:
  print(A + (K - A + 1) // 2 * (B - A) + (K - A + 1) % 2)


### FIXED CODE ###

K, A, B = map(int, input().split())
if 0 <= A - B + 2:
  print(K + 1)
else:
  print(A + (K - A + 1) // 2 * (B - A) + (K - A + 1) % 2)
n, m = list(map(int, input().split()))
par = list(range(n+1))
dis = [0] * (n+1)

def root(x):
  if x == par[x]:
    return x
  r = root(par[x])
  dis[x] += dis[par[x]]
  par[x] = r
  return r

def cost(x):
  # xからxの根までのコスト
  if x == par[x]:
    return 0
  return dis[x] + cost(par[x])

for _ in range(m):
  l, r, d = list(map(int, input().split()))
  # 根が違ってればマージ
  # 同じなら入力されたdistanceがこれまでの入力データからなる
  # 現在の木の構造から計算した数値とあっているか判断
  rootl, rootr = root(l), root(r)
  if rootl != rootr:
    # lをrにマージする
    if r == rootr:
      dis[rootl] = d - cost(l)
    else:
      dis[rootl] = d - (cost(l) - cost(r))
    par[rootl] = r
  else:
    # コストが同じかどうか
    if d == cost(dis[l]) - cost(dis[r]):
      continue
    else:
      print("No")
      exit()
print("Yes")

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

class WeightedUnionFindTree:
  def __init__(self, n):
    self.par = list(range(n))
    self.rank = [0 for _ in range(n)]
    self.weight = [0 for _ in range(n)]
   
  def root(self, t):
    if t == self.par[t]:
      return t
    # 経路圧縮してみる
    r = self.root(self.par[t])
    self.weight[t] += self.weight[self.par[t]]
    self.par[t] = r
    return r
   
  def rec_weight(self, t):
    if t == self.par[t]:
      return 0
    return self.weight[t] + self.rec_weight(self.par[t])
   
  def same(self, x, y):
    return self.root(x) == self.root(y)
     
  def unite(self, x, y, w):
    rootx = self.root(x)
    rooty = self.root(y)
    if rootx != rooty:
      if y != rooty:
        # 直接yにつなげる
        self.weight[rootx] = w - self.rec_weight(x)
      else:
        # 根につなげる
        self.weight[rootx] = w - (self.weight[x] - self.weight[y])
      # ここで親を更新
      self.par[rootx] = y
    else:
      return w == self.diff(x, y)
 
  def diff(self, x, y):
    return self.rec_weight(x) - self.rec_weight(y)

n, m = list(map(int, input().split()))
par = list(range(n+1))
dist = [0 for _ in range(n+1)]


wuft = WeightedUnionFindTree(n+1)
flag = True
for _ in range(m):
  l, r, d = list(map(int, input().split()))
  # 根が異なってたらとりあえず併合、同じならdifを取って整合性を確かめる
  a = wuft.unite(l, r, d)
  if a is not None:
    if a == False:
      flag = False
"""
[print("[{}]{}".format(idx, v), end=" ") for idx, v in enumerate(wuft.par)]
print()
[print("[{}]{}".format(idx, v), end=" ") for idx, v in enumerate(wuft.weight)]
print()
"""

print("Yes" if flag else "No")
n, k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))

Min = 0
Max = 0

comb_min = 1
comb_max = 1

a_sort = sorted(a)

def SUM(a):
    count = 0
    comb = 1
    for i, num in enumerate(a_sort):
        if i == k-1:
            count += num
        elif i >= k-1:
            comb = comb * i / (i-k+1)
            count += divmod((comb * num) , (10e08+7))[1]
            count = count % (10e08+7)
    return count

Min = SUM(a_sort)
Max = SUM(a_sort.reverse())

print(int( (Min - Max + (10e08+7)) % (10e08+7)))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
 
class Combination():
    # コンストラクタ
    def __init__(self, N:int, P:int):
        self.N = N
        self.P = P
 
        # fact[i] = (i! mod P)
        self.fact = [1, 1]   
        # factinv[i] = ((i!)^(-1) mod P)
        self.factinv = [1, 1]
        # factinv 計算用
        self.inv = [0, 1]    
 
        for i in range(2, N+1):
            self.fact.append((self.fact[-1] * i) % P)
            self.inv.append((-self.inv[P % i] * (P // i)) % P)
            self.factinv.append((self.factinv[-1] * self.inv[-1]) % P)
    
    # nCk (mod P)   (ただし、n<=N)
    def getComb(self, n:int, k:int):
        if (k < 0) or (n < k):
            return 0
        k = min(k, n - k)
        return self.fact[n] * self.factinv[k] * self.factinv[n-k] % self.P
 
def main():
    N,K = map(int,input().split())
    A = sorted([int(i) for i in input().split()])
 
    mod = 10**9+7
 
    COMB = Combination(N,mod)
 
    cmb = [0] * (N-K+1)
    for i in range(N-K+1):
        cmb[i] = COMB.getComb(i+(K-1),K-1)
 
    sum_max = 0
    for i in range(K-1,N):
        sum_max = (sum_max + cmb[i-(K-1)] * A[i]) % mod
 
    sum_min = 0
    for i in range(N-K,-1,-1):
        sum_min = (sum_min + cmb[(N-K)-i] * A[i]) % mod
 
    answer = sum_max - sum_min
    print(answer % mod)
 
if __name__ == "__main__":
    main()
N=int(input())
t=[]
x=[]
y=[]
#t.append(0)
#x.append(0)
#y.append(0)
t_cur=0
x_cur=0
y_cur=0

for i in range(N):
  plan=input().split(' ')
  t.append(int(plan[0]))
  x.append(int(plan[1]))
  y.append(int(plan[2]))

for i in range(N):
  t_gap=t[i]-t_cur
  abs(x_gap)=x[i]-x_cur
  abs(y_gap)=y[i]-y_cur

  dist=x_gap+y_gap

#  print("trip=",t[i],x[i],y[i])
#  print("t_gap=",t_gap)
#  print("dist=",dist)
  if (t_gap-dist)>=0 and (t_gap-dist)%2==0:
    t_cur=t[i]
    x_cur=x[i]
    y_cur=y[i]
  else:
    print("No")
    exit()
print("Yes")


### FIXED CODE ###

N=int(input())
t=[]
x=[]
y=[]
#t.append(0)
#x.append(0)
#y.append(0)
t_cur=0
x_cur=0
y_cur=0

for i in range(N):
  plan=input().split(' ')
  t.append(int(plan[0]))
  x.append(int(plan[1]))
  y.append(int(plan[2]))

for i in range(N):
  t_gap=t[i]-t_cur
  x_gap=abs(x[i]-x_cur)
  y_gap=abs(y[i]-y_cur)

  dist=x_gap+y_gap

#  print("trip=",t[i],x[i],y[i])
#  print("t_gap=",t_gap)
#  print("dist=",dist)
  if (t_gap-dist)>=0 and (t_gap-dist)%2==0:
    t_cur=t[i]
    x_cur=x[i]
    y_cur=y[i]
  else:
    print("No")
    exit()
print("Yes")
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

shaku = []

for i in range(n-k+1):
    start = i
    end = start + k
    h = a[start] * a[start+1]
    now = start + 2
    while now < end:
        h *= a[now]
        now += 1

    shaku.append(h)

for i in range(len(shaku)-1):
    if (shaku[i] < shaku[i+1]):
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

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

ans = []
for i in range(n-k):
    if (a[i] < a[i+k]):
        ans.append("Yes")
    else:
        ans.append("No")

for i in range(len(ans)):
    print(ans[i])
#!/usr/bin/env python3

import sys

def p3(v):
 return v*v*v

if __name__ == '__main__':
 in = sys.stdin.read()
 print('{}'.format( p3( int(in) ) ) )

### FIXED CODE ###

#!/usr/bin/env python3

import sys

def cube(x):
	if not isinstance(x,int):
		x = int(x)
	return x*x*x

if __name__ == '__main__':
	i = sys.stdin.readline()
	print('{}'.format( cube( int(i) ) ))
inf = 1 << 20
need = -1, 2, 5, 5, 4, 5, 6, 3, 7, 6

n, m = map(int, input().split())
a = map(int, input().split())
d = {need[x]: x for x in sorted(a)}
# {必要本数:数字}
# sortedで昇順にすることで、同じ本数のとき最大値が残る

dp = [-inf] * (n + 1)
dp[0] = 0
# dp[k]:=k本で構成可能な最大桁数

for j in range(1, n + 1):
    dp[j] = max((dp[j - cnt] for cnt in d if j - cnt >= 0), default=-inf) + 1

ret = []
r = dp[n]

curr = n
while r > 0:
    for cnt, num in sorted(d.items(), key=lambda x: x[1], reverse=True):
        if dp[curr - cnt] == r - 1:
            ret.append(num)
            r -= 1
            curr -= cnt
            break

ret.sort(reverse=True)
print(''.join(map(str, ret)))


### FIXED CODE ###

def chmax(x, y):
    if x == '-':
        return y

    lx = len(x)
    ly = len(y)
    if lx < ly:
        return y
    elif lx == ly:
        if x < y: return y
        else: return x
    else:
        return x


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

cnt = [N + 1, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = ['-' for _ in range(N + 10 + 1)]
dp[0] = ''
# dp[j]: j 本使ってできる最大の数

for i in range(N + 1):
    # print(dp)
    if dp[i] == '-': continue
    for aa in a:
        dp[i + cnt[aa]] = chmax(dp[i + cnt[aa]], dp[i] + str(aa))

print(dp[N])
N = int(input())
list = [1,2,3,4,5,6,7,8,9,10,12,14,16,18,15,21,24,27,20,28,32,36,25,35,40,45,30,42,48,54,49,56,63,64,72,81]
for N in list:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

A,B = map(int,input().split())
if A < 10:
  if B < 10:
    print(A*B)
  else:
    print("-1")
else:
  print("-1")
def cal_cnt(num):
  cnt = 0
  for bit in format(num, 'b'):
    if bit == '1':
      cnt += 1

  return cnt


def main():
  n = int(input())
  src = input()
  base = int(src, 2)
  base_cnt = src.count('1')

  basep = base % (base_cnt + 1)
  basem = base % (base_cnt - 1)

  memo = tuple(map(cal_cnt, range(n)))

  dp = [None] * (n + 1)
  dp[0] = 0

  def f(num, cnt):
    if num < n and dp[num] is not None:
      return dp[num]

    nxt = num % cnt
    res = 1 + f(nxt, memo[nxt])
    if num < n:
      dp[num] = res

    return res


  for i in range(n - 1, -1, -1):
    num = None

    if src[n - i - 1] == '0':
      mod = base_cnt + 1
      num = ((basep + pow(2, i, mod)) % mod)
    else:
      mod = base_cnt - 1
      num = ((basem - pow(2, i, mod)) % mod)

    print(1 + f(num, memo[num]))


main()


### FIXED CODE ###


def f(n):
  cnt = 0
  while n:
      cnt += 1
      n = n % bin(n).count('1')

  return cnt

def main():
  n = int(input())
  src = input()
  base = int(src, 2)
  base_cnt = src.count('1')

  basep = base % (base_cnt + 1)
  basem = base % (base_cnt - 1) if base_cnt > 1 else 0

  for i, s in enumerate(src):
    i = n - 1 - i
    num = None

    if s == '0':
      mod = base_cnt + 1
      num = (basep + pow(2, i, mod)) % mod
    elif base_cnt > 1:
      mod = base_cnt - 1
      num = (basem - pow(2, i, mod)) % mod
    else:
      print(0)
      continue

    print(1 + f(num))


main()
N = int(input())


def digit(N):
    d = 0
    while N >= 1:
        N /= 10
        d += 1
    return d


f = []
for i in range(1, N):
    if i * i > N:
        break
    if N % i == 0:
        d1 = digit(i)
        d2 = digit(int(N/i))
        f.append(max(d1, d2))

print(min(f))


### FIXED CODE ###

import math
N = int(input())


def digit(N):
    d = 0
    while N >= 1:
        N /= 10
        d += 1
    return d


f = []
for i in range(1, int(math.sqrt(N))+1):
    if N % i == 0:
        d1 = digit(i)
        d2 = digit(int(N/i))
        f.append(max(d1, d2))

print(min(f))
n = int(input())
l = [*map(int, input().split())]
print(1 / sum(1 / e for e in l))

### FIXED CODE ###

n = int(input())
print(1 / sum(1 / e for e in map(int, input().split())))
N=int(input())
p=list(map(int,input().split()))
a=[]
for i in range(N):
  for k in range(i):
    if p[i]>=p[k]:
     a.append(p[i])

print(N-len(c))

### FIXED CODE ###

N=int(input())
p=list(map(int,input().split()))
a=[]
k=p[0]
for i in range(1,N):
    if k>p[i]:
     a.append(p[i])
     k=p[i] 
print(len(a)+1)
import re

def main():
    s = list(input())
    sr = ''.join(list(reversed(s)))
    t = ['dream', 'dreamer', 'erase', 'eraser']
    tr = list()
    for i in t:
        tr.append(''.join(list(reversed(i))))
    while sr:
        flag = False
        for i in tr:
            if sr.startswith(i):
                sr = sr.replace(i ,'', 1)
                flag = True
        if not flag:
            print('NO')
            break
        if st == '':
            print('YES')
            break
if __name__ == '__main__':
    main()

### FIXED CODE ###

import re

def main():
    s = list(input())
    sr = ''.join(list(reversed(s)))
    t = ['dream', 'dreamer', 'erase', 'eraser']
    tr = list()
    for i in t:
        tr.append(''.join(list(reversed(i))))
    while sr:
        flag = False
        for i in tr:
            if sr.startswith(i):
                sr = sr.replace(i ,'', 1)
                flag = True
        if not flag:
            print('NO')
            break
        if sr == '':
            print('YES')
            break
if __name__ == '__main__':
    main()
a

### FIXED CODE ###

n = int(input())
d,x = map(int, input().split())
ans = 0
for i in range(n):
    a = int(input())
    j = 0
    while a*j+1 <= d:
        j += 1
    ans += j
print(ans+x)
import numpy as np
 
 
if __name__ == '__main__':
    List = [list(map(int, input().split())) for i in range(2)]
    N = List[0][0]
    buka = np.array(List[1][:])
 
 
    l_out = np.zeros(N,dtype=int)
 
    for i in range(N-1):
        l_out[buka[i]-1] += 1
 
    for i in range(N):
        print(l_out[i])
 

### FIXED CODE ###

import math

def circle_round(R):
 return 2 * math.pi * R

if __name__ == '__main__':
  R = int(input())
  print(circle_round(R))
import math

N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
maxA = A[len(A) - 1]
valid = [True] * (maxA + 1)
for i in range(1, len(valid)):
    if valid[i] == False or not i in A:
        continue
    else:
        for j in range(2, maxA // i + 1):
            valid[j * i] = False
count = 0
for i in range(len(A)):
    if i == 0 and A[i] == A[i+1]:
        continue
    if i != 0 and A[i-1] == A[i]:
        continue
    if valid[A[i]]:
        count += 1
print(count)


### FIXED CODE ###

import math

N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
maxA = A[len(A)-1]
valid = [True] * maxA

for i in range(len(A)):
    if valid[A[i]-1] == False:
        continue
    if i != 0 and A[i-1] == A[i]:
        valid[A[i]-1] = False
    else:
        for j in range(A[i]*2, maxA+1, A[i]):
            valid[j-1] = False

count = 0
for i in range(len(A)):
    if valid[A[i]-1] == True:
        count += 1
print(count)
n, d = map(int, input().split())
s == 0
for i in range(n+1):
	x, y = map(int,input().split())
	if x**2+y**2 <= d**2:
		s = s+1
print(s)

### FIXED CODE ###

n, d = map(int, input().split())
s = 0
for i in range(n):
	x, y = map(int, input().split())
	if x**2+y**2 <= d**2:
		s += 1
print(s)