Harryxun/stf_run huggingface dataset:
import random

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

def is_prime(q,k=50):
    q = abs(q)
    #計算するまでもなく判定できるものははじく
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #判定をk回繰り返す
    for i in xrange(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]の範囲すべてをチェック
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

x=[]
y=[]
z=[]

if a==1:
  x.append(1)
else:
  fct_a = factorize(a)
  for div in divisorize(fct_a):
    x.append(num(div))

if b==1:
  y.append(1)
else:
  fct_b = factorize(b)
  for div in divisorize(fct_b):
    y.append(num(div))

z=x+y
w=[m for m in set(z) if z.count(m) > 1]

c=0

for i in range(0,len(w)):
  if is_prime(w[i]):
    c+=1
print(c+1)

### FIXED CODE ###

import random

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

def is_prime(q,k=50):
    q = abs(q)
    #計算するまでもなく判定できるものははじく
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #判定をk回繰り返す
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]の範囲すべてをチェック
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a

def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

x=[]
y=[]
z=[]

if a==1:
  x.append(1)
else:
  fct_a = factorize(a)
  for div in divisorize(fct_a):
    x.append(num(div))

if b==1:
  y.append(1)
else:
  fct_b = factorize(b)
  for div in divisorize(fct_b):
    y.append(num(div))

z=x+y
w=[m for m in set(z) if z.count(m) > 1]

c=0

for i in range(0,len(w)):
  if is_prime(w[i]):
    c+=1
print(c+1)
from collections import deque
X, Y, Z, K = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

A.append(-int(1e+15))
B.append(-int(1e+15))
C.append(-int(1e+15))

Aq = deque(A)
Bq = deque(B)
Ar = [Aq.popleft()]
Br = [Bq.popleft()]
maximum = min((len(A)-1) + (len(B)-1), 3000)
preA = Ar[0]
preB = Br[0]

while len(Ar) + len(Br) < maximum:
    if  Ar[0] - Aq[0] > Br[0] - Bq[0]:
        Br.append(Bq.popleft())
        preB = Br[-1]
    else:
        Ar.append(Aq.popleft())
        preA = Ar[-1]

AB = [Ar[i] + Br[j] for i in range(len(Ar)) for j in range(len(Br))]
AB = sorted(AB, reverse=True)

AB.append(-int(1e+15))

ABq = deque(AB)
Cq = deque(C)
ABr = [ABq.popleft()]
Cr = [Cq.popleft()]
maximum = min((len(AB)-1) + (len(C)-1), 3000)
preAB = ABr[0]
preC = Cr[0]
while len(ABr) + len(Cr) < maximum:
    if ABr[0] - ABq[0] > Cr[0] - Cq[0]:
        Cr.append(Cq.popleft())
        preC = Cr[-1]
    else:
        ABr.append(ABq.popleft())
        preAB = ABr[-1]

ABC = [ABr[i] + C[j] for i in range(len(ABr)) for j in range(len(Cr))]
ABC = sorted(ABC, reverse=True)

for i in range(K):
    print(ABC[i])


### FIXED CODE ###

from collections import deque
X, Y, Z, K = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

A.append(-int(1e+15))
B.append(-int(1e+15))
C.append(-int(1e+15))

Aq = deque(A)
Bq = deque(B)
Ar = [Aq.popleft()]
Br = [Bq.popleft()]
maximum = min((len(A)-1) + (len(B)-1), K+1)
preA = Ar[0]
preB = Br[0]

while len(Ar) + len(Br) < maximum:
    if  Ar[0] - Aq[0] > Br[0] - Bq[0]:
        Br.append(Bq.popleft())
        preB = Br[-1]
    else:
        Ar.append(Aq.popleft())
        preA = Ar[-1]

AB = [Ar[i] + Br[j] for i in range(len(Ar)) for j in range(len(Br))]
AB = sorted(AB, reverse=True)

AB.append(-int(1e+15))

ABq = deque(AB)
Cq = deque(C)
ABr = [ABq.popleft()]
Cr = [Cq.popleft()]
maximum = min((len(AB)-1) + (len(C)-1), K+1)
preAB = ABr[0]
preC = Cr[0]
while len(ABr) + len(Cr) < maximum:
    if ABr[0] - ABq[0] > Cr[0] - Cq[0]:
        Cr.append(Cq.popleft())
        preC = Cr[-1]
    else:
        ABr.append(ABq.popleft())
        preAB = ABr[-1]

ABC = [ABr[i] + Cr[j] for i in range(len(ABr)) for j in range(len(Cr))]
ABC = sorted(ABC, reverse=True)

for i in range(K):
    print(ABC[i])
#coding:utf-8
N = int(input())

class Tree:
    def __init__(self, ID,p=-1):
        self.ID = ID

    def makeTree(self, tree):
        ID = tree.ID
        if ID == -1:
            return
        else:
            [ID,l,r] = trees[ID]
            tree.l = Tree(l)
            tree.r = Tree(r)
            treeL = tree.l
            treeR = tree.r
            treeL.p = tree
            treeR.p = tree

            self.makeTree(self,treeL)
            self.makeTree(self,treeR)

def preParse(tree):
    ID = tree.ID
    if ID == -1:
        return
    else:
        global preList
        preList.append(ID)
        treeL = tree.l
        treeR = tree.r
        preParse(treeL)
        preParse(treeR)
        
def inParse(tree):
    ID = tree.ID
    if ID == -1:
        return
    else:
        global inList
        treeL = tree.l
        treeR = tree.r
        inParse(treeL)
        inList.append(ID)
        inParse(treeR)

def posParse(tree):
    ID = tree.ID
    if ID == -1:
        return
    else:
        global posList
        treeL = tree.l
        treeR = tree.r
        posParse(treeL)
        posParse(treeR)
        posList.append(ID)
        
    
trees = [list(map(int,input().split())) for i in range(N)]
tree = Tree(0)
Tree.makeTree(Tree,tree)

preList = []
inList = []
posList = []
preParse(tree)
inParse(tree)
posParse(tree)

def convert(List):
    return " ".join([str(num) for num in List])
a = convert(preList)
b = convert(inList)
c = convert(posList)
print("Preorder")
print(a)
print("Inorder")
print(b)
print("Postorder")
print(c)


### FIXED CODE ###

#coding:utf-8
N = int(input())
T = []
class Tree:
    def __init__(self,ID,l=None,r=None,p=-1):
        self.ID = ID
        self.l = l
        self.r = r
        self.p = p

    def makeTree(self):
        for i in range(N):
            T.append(Tree(i))


def preParse(tree):
    if tree == None:
        return
    else:
        ID = tree.ID
        global preList
        preList.append(ID)
        preParse(tree.l)
        preParse(tree.r)
        
def inParse(tree):
    if tree == None:
        return
    else:
        ID = tree.ID
        global inList
        inParse(tree.l)
        inList.append(ID)
        inParse(tree.r)

def posParse(tree):
    if tree == None:
        return
    else:
        ID = tree.ID
        global posList
        posParse(tree.l)
        posParse(tree.r)
        posList.append(ID)
        
    
trees = [list(map(int,input().split())) for i in range(N)]
Tree.makeTree(Tree)
for i in range(N):
    ID,l,r = trees[i]
    tree = T[ID]
    if l != -1:
        T[l].p = tree
        tree.l = T[l]
    if r != -1:
        T[r].p = tree
        tree.r = T[r]
    
for i in range(N):
    if T[i].p == -1:
        parent = T[i]

preList = []
inList = []
posList = []
preParse(parent)
inParse(parent)
posParse(parent)

def convert(List, order):
    a =  " " + " ".join([str(num) for num in List])
    print("{}".format(order))
    print(a)
convert(preList, "Preorder")
convert(inList, "Inorder")
convert(posList, "Postorder")
r=input()

print(3*int(r)*int(r)

### FIXED CODE ###

r=input()

print(3*int(r)*int(r))
a = int(input())
c = b.split()
a = c[-1]
if a ==2 or a== 4 or a==5 or a== 7 or a== 9:
	print("hon")
elif a == 0 or a== 1 or a==6 or a == 8:
	print("pon")
else:
  print("bon")

### FIXED CODE ###

b = int(input())
a = b % 10
if a ==2 or a== 4 or a==5 or a== 7 or a== 9:
	print("hon")
elif a == 0 or a== 1 or a==6 or a == 8:
	print("pon")
else:
  print("bon")
k,x=[int(i)for i in input().split()]
if x>500k:
  print('No')
else:
  print('Yes')

### FIXED CODE ###

k,x=[int(i)for i in input().split()]
if 500*k>=x:
  print('Yes')
else:
  print('No')
a=input()
b=a.split()
plint(sorted.b)


### FIXED CODE ###

a=input()
b=a.split()
c=list()
for d in b:
    c.append(int(d))
d=sorted(c)
print(d[0],d[1],d[2])
x = str(input())
if x.isupper() == Ture:
  print("A")
else:
  print("a")

### FIXED CODE ###

x = input()

if str(x).isupper() == True:
  print("A")
else:
  print("a")
a,b,k = map(int,input().spit())
if a > k:
  print(a-k, b)
elif a+b >k:
  print(0, a+b -k)
else:
  print(0,0)

### FIXED CODE ###

A, B, K = map(int, input().split())
if A > K:
    print(A-K, B)
elif A+B > K:
    print(0, A+B-K)
else:
    print(0, 0)
import math
n, k = map(int, input().split())
p = 0
for i in range(1,num):
  tmp = 1
  while i * temp < k:
    temp *= 2
  p += 1/temp
print(p/n)

### FIXED CODE ###

import math
n, k = map(int, input().split())
p = 0
for i in range(1,n+1):
  temp = 1
  while i * temp < k:
    temp *= 2
  p += 1/temp
print(p/n)
from collections import deque


H, W = map(int, input().split())
A = [list('#' * (W + 2))]
q = deque()
A_append = A.append
q_append = q.append
for _ in range(H):
    a = input()
    A_append(list('#' + a + '#'))
A.append(list('#' * (W + 2)))
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(1, H + 1):
    for j in range(1, W + 1):
        if A[i][j] == '#':
            q_append([i, j, 0])

ans = 0

while len(q) != 0:
    p = q.popleft()
    for k in range(4):
        y = p[1] + dy[k]
        x = p[0] + dx[k]
        c = p[2]
        ans = max(ans, c)
        if A[y][x] == '.':
            A[y][x] = '#'
            q_append([y, x, c + 1])

print(ans)


### FIXED CODE ###

from collections import deque


H, W = map(int, input().split())
A = [list('#' * (W + 2))]
q = deque()
A_append = A.append
q_append = q.append
for _ in range(H):
    a = input()
    A_append(list('#' + a + '#'))
A.append(list('#' * (W + 2)))
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(1, H + 1):
    for j in range(1, W + 1):
        if A[i][j] == '#':
            q_append([i, j, 0])

ans = 0

while len(q) != 0:
    p = q.popleft()
    for k in range(4):
        y = p[0] + dy[k]
        x = p[1] + dx[k]
        c = p[2]
        ans = max(ans, c)
        if A[y][x] == '.':
            A[y][x] = '#'
            q_append([y, x, c + 1])

print(ans)
h,w,d = map(int,input().split(" "))
board = [input().split(" ") for i in range(h)]

q = int(input())
for i in range(q):
    l,r = map(int,input().split(" "))
    n = int((r-l)/d)
    count = 0
    x = []
    y = []
    for k in range(h):
        if str(l) in board[k]:
            x.append(board[k].index(str(l)))
            y.append(k)
    for j in range(n):
        for k in range(h):
            if str(l+(j+1)*d) in board[k]:
                x.append(board[k].index(str(l+(j+1)*d)))
                y.append(k)
        count = count + abs(int(x[j+1])-int(x[j])) + abs(y[j+1]-y[j])
    print(count)

### FIXED CODE ###

n = int(input())
m=0
a=0
r=0
c=0
h=0
name = [list(str(input().split())) for i in range(n)]
for i in range(n):
    if name[i][2] == "M":
        m = m+1
    elif name[i][2] == "A":
        a = a+1
    elif name[i][2] == "R":
        r = r+1
    elif name[i][2] == "C":
        c = c+1
    elif name[i][2] == "H":
        h = h+1
print(m*a*r + m*a*c + m*a*h + m*r*c + m*r*h + m*c*h + a*r*c + a*r*h + a*c*h + r*c*h)
x = int(input())
a = list(map(int, input().split()))
al = [0]*(max(a)+1)
for i in a:
    al[i] += 1
index = al.index(max(al))

if index == 1:
    index += 1
elif index == max(a)-1:
    index -= 1

if x == 1:
    print(x)
elif x == 2:
    if abs(a[0] - a[1]) <= 1:
        print(2)
    else:
        print(1) 
else:
    print(al[index-1] + al[index] + al[index+1])


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
al = [0]*(10**5+2)

for i in a:
    al[i] += 1
    al[i+1] += 1
    al[i+2] += 1

print(max(al))
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, pair<T1, T2> P)
{
    return s << '<' << P.first << ", " << P.second << '>';
}
template <class T>
ostream &operator<<(ostream &s, vector<T> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        if (i > 0)
        {
            s << " ";
        }
        s << P[i];
    }
    return s;
}
template <class T>
ostream &operator<<(ostream &s, vector<vector<T>> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        s << endl
          << P[i];
    }
    return s << endl;
}
template <class T>
ostream &operator<<(ostream &s, set<T> P)
{
    EACH(it, P) { s << "<" << *it << "> "; }
    return s << endl;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, map<T1, T2> P)
{
    EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; }
    return s << endl;
}
typedef long long ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int func(long long num){
    int cnt = 0;
    while (num > 0)
    {
        num /= 10;
        cnt++;
    }
    return cnt;
}

int main()
{
    long long  n;
    cin >> n;
    int ans = INF;
    for (int i = 1; i <= sqrt(n) + 1; i++)
    {
        int tmp=INF;
        if (n % i == 0)
        {
            tmp = max(func(i), func(n / i));
            
        }
        ans = min(ans, tmp);
    }
    cout << ans << endl;
}

### FIXED CODE ###

def func(num):
    cnt=0
    while(num>0):
        num=int(num/10)
        cnt+=1
    return cnt

N=int(input())
ans=100
for i in range(1,int(N**(1/2)+1)):
    tmp=100
    if(N%i==0):
        tmp=max(func(i),func(N/i))
    ans=min(ans,tmp)
print(ans)
n = input()

print(n.replace("1","9").repace("9","1"))
      


### FIXED CODE ###

n = input()

print(n.replace("1","x").replace("9","1").replace("x","9"))
S = list(int(input()))
a = S.count(0)
b = S.count(1)
ans = 2 * min(a, b)
print(ans)


### FIXED CODE ###

S = list(input())
a = S.count('0')
b = S.count('1')
ans = 2 * min(a, b)
print(ans)
N = int(input())
s_list = [input() for _ in range(N)]
ans = 0
ans_list = [0, 0, 0]
for s in s_list:
  ans += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    ans_list[0] += 1
  elif s[0] == 'B':
    ans_list[1] += 1
  elif s[-1] == 'A':
    ans_list[2] += 1

if ans_list[1] == 0:
  if ans_list[0] != 0:
    if ans_list[2] != 0:
      ans += ans_list[0]
    else:
      ans += ans_list[0]-1
else:
  if ans_list[0] != 0:
    if ans_list[2] != 0:
      ans += ans_list[0] + min(ans_list[1], ans_list[2])
    else:
      ans += ams_list[0]
  else:
    ans += min(ans_list[1], ans_list[2])
print(ans)
	

### FIXED CODE ###

N = int(input())
s_list = [input() for _ in range(N)]
ans = 0
ans_list = [0, 0, 0]
for s in s_list:
  ans += s.count('AB')
  if s[0] == 'B' and s[-1] == 'A':
    ans_list[0] += 1
  elif s[0] == 'B':
    ans_list[1] += 1
  elif s[-1] == 'A':
    ans_list[2] += 1

if ans_list[1] == 0:
  if ans_list[0] != 0:
    if ans_list[2] != 0:
      ans += ans_list[0]
    else:
      ans += ans_list[0]-1
else:
  if ans_list[0] != 0:
    if ans_list[2] != 0:
      ans += ans_list[0] + min(ans_list[1], ans_list[2])
    else:
      ans += ans_list[0]
  else:
    ans += min(ans_list[1], ans_list[2])
print(ans)
M = 10**9 + 7
n, a, b = map(int, input().split())
r = (pow(2, n, M) - 1) % M
f = c = 1
for i in range(b):
  f = f * (i + 1) % M
  c = c * (n - i) % M
  if i + 1 == a:
    r = (r - c * pow(f, M - 2, M)) % M
print((r - c * pow(f, M - 2, M) % M))


### FIXED CODE ###

input()
a = list(map(int, input().split()))
print(min(sum((x - p)**2 for x in a) for p in range(1, 101)))
a = int(input())
c =0
for a in range(1,a+1):
  if ((len(str(a))% 2) == 1):
    c += 1 
print(c)

### FIXED CODE ###

a, b, c = map(int, input().split())
left_in_c = c - (a -b )
if left_in_c <=0:
  left_in_c =0
print("{}".format(left_in_c));
input()
int_list = list(map(int, input().split()))
max_num = 10**18
ans = 1

if 0 in int_list:
  print(0)
  exit()
  
for i in int_list:
    ans *= i
    if ans > max_num:
            print(-1)
        break
else:
    print(ans)


### FIXED CODE ###

A, B = map(int, input().split())
print(A*B)
c=input()
print(chr(ord(c)+1)

### FIXED CODE ###

c=input()
print(chr(ord(c)+1))
Row,Col,Ichigo=map(int,input().split())

List=[[j for j in input().split()] for i in range(Row)]

cnt = 1
add = 0

ans = []

for i in range(Row):
  
  arr = list(List[i][0])
  ans_arr = []
  
  if "#" in arr:
    for j in range(Col):
      str = arr[j]
      if str == "#":
        cnt = cnt + add
        ans_arr.append(cnt)
        add = add + 1
      else :
        ans_arr.append(cnt)
  
  else:
    cnt = cnt - 1
    ans_arr.append(-1)
    
  cnt = cnt + 1
  ans.append(ans_arr)
  add = 0 
  
for i in range(Row):
  
  arr = ans[Row - i - 1][0]
  if arr == - 1 :
    ans_arr = ans[Row - i ]
    ans[Row - i - 1] = ans_arr
  
for List in ans:
    print(*List)

### FIXED CODE ###

Row,Col,Ichigo=map(int,input().split())

List=[[j for j in input().split()] for i in range(Row)]

cnt = 1
add = 0

ans = []

for i in range(Row):
  
  arr = list(List[i][0])
  ans_arr = []
  
  if "#" in arr:
    for j in range(Col):
      str = arr[j]
      if str == "#":
        cnt = cnt + add
        ans_arr.append(cnt)
        add = 1
      else :
        ans_arr.append(cnt)
  
  else:
    cnt = cnt - 1
    ans_arr.append(-1)
    
  cnt = cnt + 1
  ans.append(ans_arr)
  add = 0 
  
for i in range(Row):
  
  arr = ans[Row - i - 1][0]
  if arr == - 1 and Row - i != Row:
    
    ans_arr = ans[Row - i ]
    ans[Row - i - 1] = ans_arr
    
  elif i == 0 and ans[Row-1][0] == -1:
    ans_arr = ans[Row - 2 ]
    ans[Row - 1] = ans_arr
    
for i in range(Row):
  
  arr = ans[i][0]
  if arr == - 1:
    ans_arr = ans[i-1]
    ans[i] = ans_arr
    
for List in ans:
    print(*List)
n,t = map(int,input().split())
ls = [list(map(int,input().split())) for i in range(n)]
ls1 = []
for i in range(n):
    if ls[i][1] <= t:
        ls1.append(ls[i][0])
print(min(ls1))


### FIXED CODE ###

n,t = map(int,input().split())
ls = [list(map(int,input().split())) for i in range(n)]
ls1 = []
for i in range(n):
    if ls[i][1] <= t:
        ls1.append(ls[i][0])
if len(ls1) == 0:
    print("TLE")
else:
    print(min(ls1))
s = input()
print(700 + int(s.count(o)*100))

### FIXED CODE ###

s = input()
print(700 + int(s.count("o")*100))
l = input().split()
m = int(l)
N = m/3
v = pow(N,3)
print(v)

### FIXED CODE ###

s = int(input())
side = s/3
ans = pow(side,3)
print(ans)
import numpy as np

N = int(input())
A_array = np.array(input().split())

a_array = 1/A_array
print(np.sum(a_array))

### FIXED CODE ###

import numpy as np

N = int(input())
A_array = np.array([int(x) for x in input().split()])

a_array = np.sum(1/A_array)
print(1/a_array)
n = int(input())
s = input()

cand = [j for j in range(len(s)) if s[j] =="#" and s[j+1] !="#"]
count =0
if start == -1 or end == -1:
    print(0)
else:
    for i in cand:
        if s[i] == "#" and s[i+1] == ".":
            count +=1
    print(count)

### FIXED CODE ###

n = int(input())
s = input()
black = s[:0].count("#")
white = s[0:].count(".")
count = [black+white]    
    
for i in range(1, n+1):
    if s[i-1]== "#":
        black +=1
    else:
        white -=1
    count.append(white+black)
    
print(min(count))
def main():
    _ = int(input())
    A = list(map(int, input().split()))
    b1 = 0
    b2 = 0
    b4 = 0
    for a in A:
        if a == 2:
            b2 += 1
            continue
        if a // 2 > 1 and a % 2 == 0:
            b4 += 1
            continue
        b1 += 1
    if b2 > 0:
        if b4 >= b1:
            print('Yes')
            return
    else:
        if b4 + 1 >= b1:
            print('Yes')
            return
    print('No')


main()


### FIXED CODE ###

def main():
    H, W = map(int, input().split())
    N = int(input())
    A = list(map(int, input().split()))
    ans = [[0] * W for _ in range(H)]
    i = 0
    j = 0
    d = 1
    for n in range(N):
        for _ in range(A[n]):
            ans[i][j] = str(n + 1)
            if (0 > d and j == 0) or (d > 0 and j == W - 1):
                i += 1
                d *= -1
                continue
            j += d
    for r in ans:
        print(' '.join(r))


main()
n = int(input())
r_min = int(input())
r_t = int(input())
g_max = r_t - r_min
r_ min = min(r_min, r_t)

for _ in range(n-2):
    r_t = int(input())
    g_max  = max(g_max, r_t - r_min)
    r_min = min(r_min, r_t)

print(g_max)

### FIXED CODE ###

n = int(input())
r_min = int(input())
r_t = int(input())
g_max = r_t - r_min
r_min = min(r_t, r_min)

for _ in range(n - 2):
    r_t = int(input())
    g_max = max(g_max, r_t -r_min)
    r_min = min(r_t, r_min)
print(g_max)
n = int(input())
L = list(map(int, input().split()))
nagai = max(L)
if nagai > sum(L)
   print('Yes')
 else
   print('No')

### FIXED CODE ###

n = int(input())
L = list(map(int, input().split()))
nagai = int(max(L))
wa = int(sum(L))
if nagai < wa - nagai:
   print('Yes')
else:
   print('No')
n, x, t = list(map(int, input().split()))

n = math.ceil(n/x)
print(n*t)

### FIXED CODE ###

import math
n, x, t = list(map(int, input().split()))

n = math.ceil(n/x)
print(n*t)
S=int(input())
if S=="sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else:
    print("Sunny")

### FIXED CODE ###

S=input()
if S=="Sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else:
    print("Sunny")
a = int,input()
b = int,sum(a + a^2 + a^3)
print(b)

### FIXED CODE ###

a = input()
b = int(a)
print(b+b**2+b**3)
from math import pi

r = input()

print(2*r*pi)

### FIXED CODE ###

from math import pi

r = int(input())

print(2*r*pi)
n=int(input())
a=[]
for _ in range(n):
    a.append(list(map(int,input().split())))
dp=a[0]

for k in range(1,n):
    m=[0,0,0]
    for i in range(3):
        for j in range(3):
            if i!=j:
                m[i]=max(m[i],dp[j]+a[k][i])
    dp=m
print(max(m))


### FIXED CODE ###

n=int(input())
a=[]
for _ in range(n):
    a.append(list(map(int,input().split())))
for i in range(1,n):
    a[i][0]+=max(a[i-1][1],a[i-1][2])
    a[i][1]+=max(a[i-1][0],a[i-1][2])
    a[i][2]+=max(a[i-1][1],a[i-1][0])
print(max(a[n-1]))