Problem:


Score : 200 points

Problem Statement

Given is a sequence of N integers A_1, \ldots, A_N.

Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Constraints

1 \leq N \leq 100

1 \leq A_i \leq 1000

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 \ldots A_N

Output

Print a decimal number (or an integer) representing the value of \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}}.

Your output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.

Sample Input 1

2
10 30

Sample Output 1

7.5

\frac{1}{\frac{1}{10} + \frac{1}{30}} = \frac{1}{\frac{4}{30}} = \frac{30}{4} = 7.5.

Printing 7.50001, 7.49999, and so on will also be accepted.

Sample Input 2

3
200 200 200

Sample Output 2

66.66666666666667

\frac{1}{\frac{1}{200} + \frac{1}{200} + \frac{1}{200}} = \frac{1}{\frac{3}{200}} = \frac{200}{3} = 66.6666....

Printing 6.66666e+1 and so on will also be accepted.

Sample Input 3

1
1000

Sample Output 3

1000

\frac{1}{\frac{1}{1000}} = 1000.

Printing +1000.0 and so on will also be accepted.



Sample input:
2
10 30


Sample output:
7.5

Submission status: Accepted

Solution code:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix

from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！
 
def main():
    n,*a=map(int,open(0).read().split())
    print(1/sum(1/i for i in a))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
da=list(map(int,input().split()))
ans=0
for i in range(n):
    ans+=1/da[i]
print(1/ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))

ans = 0

for a in A:
    ans += 1 / a

print(1 / ans)

Submission status: Accepted

Solution code:
n=int(input())
A=list(map(int,input().split()))
ans=0
for a in A:
    ans+=1/a
print(1/ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
den = 0
for value in A:
    den += 1 / value
print(1 / den)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(N):
  ans += 1 / A[i]

print(1 / ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, A: "List[int]"):
    tmp = 0
    for a in A:
        tmp += 1 / a
    ret = 1 / tmp
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *

N = int(input())
A = list(map(int, input().split()))
k = 0
for a in A:
    k += 1/a
print(1/k)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, A: "List[int]"):
    tot = 0
    for a in A:
        tot += 1/a
    tot = 1/tot
    print(tot)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = 0
for ai in a:
    ans += 1/ai

print(1/ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [1 / int(i) for i in input().split()]

print("{:.9f}".format(1 / sum(A)))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
res = 0
for i in a:
    res += 1 / i
print(1 / res)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a = I()
    s = S()
    if a >= 3200:
        print(s)
    else:
        print("red")
    return

#B
def B():
    n = I()
    a = LI()
    ans = 0
    for i in a:
        ans += 1/i
    print(1/ans)
    return

#C
def C():

    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

#Solve
if __name__ == "__main__":
    B()

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
for a in A:
    ans += 1 / a
print(1 / ans

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  ans=ans+1/a[i]
ans=1/ans
 print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
A_lis=list(map(int,input().split())
x=0           
for i in A_lis:
   x += 1/i
ans = 1/x
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a:
  s += 1 / a
print(1 / s)

Submission status: Runtime Error

Solution code:
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(0,a-1):
  c == c + 1/b[i]
print(1/c)

Submission status: Runtime Error

Solution code:
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(0,a-1):
  c += 1/b[i]
print(1/c)

Submission status: Runtime Error

Solution code:
a = int(input())
b = list(map(int,input().split()))
c = 0
for i in range(0,a-1):
  c += c + 1/b[i]
print(1/c)

Submission status: Runtime Error

Solution code:
a = int(input())
b = list(int,input().split())
c = 1/b[0]
for i in range(a-1):
  c += c + 1/b[i]
print(1/c)

Submission status: Runtime Error

Solution code:
a = int(input())
b = list(int,input().split())
c = 1/b[0]
for i in range(a-1):
  c = c + 1/b[i]
print(1/c)

Submission status: Runtime Error

Solution code:
a = int(input())
b = list(int,input().split())
c = 1/b[0]
for i in range(len(b)-1):
  c = c + 1/b[i]
print(1/c)

Submission status: Runtime Error

Solution code:
n=int(input())
l=[]
for i in range(n):
  a=int(input())
  l.append(1/a)

print(1/sum(l))

Submission status: Runtime Error

Solution code:
n=int(input())
l=[]
for i in range(n):
  a=int(input())
  l.append(1/a)

print(sum(l))

Submission status: Runtime Error

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

import math
def lcm(x, y):
    return (x*y)//math.gcd(x, y)

ue = lcm(a[0], a[1])
if n >= 3:
    for i in range(2, n):
        ue = lcm(ue, a[i])

shita = 0
for i in range(len(a)):
    shita += ue//a[i]

ans = ue / shita
print(f"{ans:.6f}")

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
sum=0
for i in range(n):
  sum=sum+1/a[i]
print(1/ans)

Submission status: Runtime Error

Solution code:
_=input()
print(1/sum[1/r for r in list(map(int,input().split()))])

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
total=0
for i in a:
  total += 1/a
print(1/total)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))

for i in range(N):
  ans+=1/A[i]

print(1/ans)

Submission status: Runtime Error

Solution code:
input()
l = list(map(int,input().split()))
s = 0
s += 1/i for i in l
print(round(1/s,3))

Submission status: Runtime Error

Solution code:
i=int(input())
def sum(1/n):
  if n==1:
    return 1
  else:
    return 1/n + sum(1/n-1)
print(sum(i))

Submission status: Runtime Error

Solution code:
n = int(input())
res = list(map(int, input().split()))
ans = 0 
for x in res:
  ans += 1/res
print(1/ans)

Submission status: Runtime Error

Solution code:
N=int(input())
S=0
A=list(map(int,input().split()))
for i in range(N):
  S += 1/i
print(1/S)

Submission status: Runtime Error

Solution code:
N=int(input())
S=0
A=list(map(int,input().split()))
for i in range(N):S+=1/i
print(1/S)

Submission status: Runtime Error

Solution code:
n = int(input())

a = map(list(int,input().split()))
ans = 0
for i in a:
    ans += i
print(1 / ans)

Submission status: Runtime Error

Solution code:
def resolve():
    N = int(input())
    all = list(map(int, input().split()))
    ans = 0
    for i in all:
        ans += 1/i
    print(dad)
resolve()

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=/A[0]
for i in range(1,N-1):
  ans+=1/A[i]
print(1/ans)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map,int().split())
ans=/A[0]
for i in range(1,N-1):
  ans+=1/A[i]
print(1/ans)

Submission status: Runtime Error

Solution code:
from sys import stdin, setrecursionlimit
import numpy as np


def main():
    input = stdin.buffer.readline
    n = int(input())
    a = list(map(int, input().split()))

    num = np.prod(a)

    den = sum([num // a[i] for i in range(n)])

    print(num / den)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(x) for x in input().split()]

ans=0
for i in range(a):
  ans+=1/i
print(1/ans)

Submission status: Runtime Error

Solution code:
n =  int(input())
a =[int(input) for _ in range(n)]
b = 0
rev_a =[]

for i in a:
    j = 1 / i
    rev_a.append(j)

for k in rev_a:
    b += k

print(1/b)

Submission status: Runtime Error

Solution code:
n =  int(input())
a =[int(input) for _ in range(n)]
rev_a =[]

for i in a:
    j = 1 / i
    rev_a.append(j)
    
print(1/ sum(rev_a))

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
a = list(map(int,input().split()))
lcm = np.lcm.reduce(a)
d = [0]*n

for i in range(n):
    d[i] = lcm//a[i]

print(lcm/sum(d))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))

for i in range(N+1):
    A[i] = 1 / A[i]

print(1 / sum(A))

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
sum=0
for ll in list:
  sum+=1/ll
print(1/sum)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().solit())))
print(1/sum(1/A))

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
print(b/a)

Submission status: Runtime Error

Solution code:
N=int(input())
s=0
for i in range(N):
  a=int(input())
  s+=1/a
print(1/s)

Submission status: Runtime Error

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#from bisect import insort_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
#import heapq
#import numpy as np
#INF = float("inf")
N = int(input())
A = list(map(int,input().split()))
s = 0
for i in A:
    s += A**(-1)
print(s**(-1))

Submission status: Runtime Error

Solution code:
n=int(input())
A=np.array(list(map(int,input().split())))
print(1/sum(1/A))

Submission status: Runtime Error

Solution code:
import numpy as np
n=int(input())
a=np.array(list(map(float,input().split())))
print(float(1/sum(1/a_array)))

Submission status: Runtime Error

Solution code:
import numpy as np
N=int(input())
A=list(map(int,input().split())
B=np.array(A)
C=B**-1
print((C.sum())**-1)

Submission status: Runtime Error

Solution code:
n=int(input())
lista=list(map(int,input().split()))
count=0
for a in lista:
  count+=1/a
print(i/count)

Submission status: Runtime Error

Solution code:
N-int(input())
A=list(map(int,input().split()))
a=0
for i in range(N-1):
    a+=1/A[i]
print(1/a)

Submission status: Runtime Error

Solution code:
import numpy as np
from decimal import Decimal
n = int(input())
a = list(map(int, input().split()))
S = np.int64(np.prod(a))
T = 0
for x in a:
    T += Decimal(S / x)
print(Decimal(S / T))

Submission status: Runtime Error

Solution code:
import numpy as np
from decimal import Decimal
n = int(input())
a = list(map(int, input().split()))
S = np.prod(a)
T = 0
for x in a:
    T += Decimal(S / x)
print(Decimal(S / T))

Submission status: Runtime Error

Solution code:
n = int(input())
x,y = map(int,input().split())
print(1 / (1 / x + 1 / y))

Submission status: Runtime Error

Solution code:
import math
import numpy as np 
n = int(input())
A = list(map(int, input().split()))
gcd = 0
if n == 1:
    print(A[0])

else:
    #最大公約数を求める
    for i in range(n-1):
        if i == 0:
            gcd = math.gcd(A[i], A[i+1])
        else:
            gcd = math.gcd(gcd, A[i+1])

    prod = np.prod(A)

    #最小公倍数
    lcm = prod / gcd

    #逆数
    ans = 0
    #分子の総和を求める
    for i in range(n):
        ans += lcm/A[i]
    ans /= lcm
    ans = 1 / ans

    print(ans)

Submission status: Runtime Error

Solution code:
import math

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

a = A[0]

for i in range(1, N):
    a = (a * A[i]) // math.gcd(a, A[i])

b = 0

for i in range(N):
    b += a // A[i]

print(a / b)

Submission status: Runtime Error

Solution code:
import math

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

a = A[0]

for i in range(1, N):
    a = int((a * A[i]) / math.gcd(a, A[i]))

b = 0

for i in range(N):
    b += a // A[i]

print(a / b)

Submission status: Runtime Error

Solution code:
import math
total = 0
A = int(input())
listB = list(map(int,input().split()))
if 1 < A:
    B = listB[0] * listB[1] // math.gcd(listB[0],listB[1])
    for i in range(A-2):
        B = listB[i+2] * B // math.gcd(B,listB[i+2])
else:
    B = listB[0]
for i in listB:
    total += B // i
print(B / total)

Submission status: Runtime Error

Solution code:
N=int(input())
A=map(int, input().split())
ans = 0
for i in range(N):
  ans = ans + 1/A[i]
print(1/ans)

Submission status: Runtime Error

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = int(input())
    b = [int(i) for i in input().split()]

    count =Decimal(0)

    for i in b:
        count = count.sum(Decimal(1) / Decimal(i))
    
    print(Decimal(1) / Decimal(count))

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(int(input()))
sum=0
i=0
while i<=N-1:
  sum+=1/A[i]
  i+=1
rev=1/sum
print(rev)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(int,input())
sum=0
i=0
while i<=N-1:
  sum+=1/A[i]
  i+=1
rev=1/sum
print(rev)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(e) for e in range(N)]
V = 0
for i in range(N):
    V += 1/A[i]
print(1/V)

Submission status: Runtime Error

Solution code:
N = int(input())
A = map(int, input().split())

sum = 0
sum += 1/A
ans = 0
ans += 1/sum
print(ans)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
i = 0
while 2*a+(a-1)*(i-2)  <b:
  i += 1
print(i+1)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
b =[]
for i in range(n):
  b.append(1/a[n])
c = sum(b)
print(1/c)

Submission status: Runtime Error

Solution code:
_ = input()
print(f"{(1 / sum(1 / x for x in map(int, input().split()))):.16g}")

Submission status: Runtime Error

Solution code:
n = int(input())
lis = list(map(int,input().split()))
ing_total = 0

for i in range(n):
    ing_total+= 1 / lis[i]

print(int(1/ing_total)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split())
sum_m=0
for i in l:
	sum_m+=1/i
print(1/sum_m)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(input().split())
sum_m=0
for i in l:
	sum_m+=1/i
print(1/sum_m)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

bun = 0
for i in range(N):
  bun += 1/A[i]
  
ans = 1/ans
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input)
A = [float(i) for i in input().split()]

c = 0

for i in A:
  c += (1/A[i])

print(float(1/c))

Submission status: Runtime Error

Solution code:
N = int(input)
A = [int(i) for i in input().split()]

c = 0

for i in A:
  c += (1/A[i])

print(float(1/c))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
print((b-2)//(a-1)+1)

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
a = list(map(int, input().split()))
print(np.prod(a)/sum(a))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
print("{:.10f}"sum(list(map(lambda x: 1/x, a))))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
print("{:.10f}"sum((map(lambda x: 1/x, a))))

Submission status: Runtime Error

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

sum = 0

for i in range(i):
  sum += 1/l[i]
print(1/sum)

Submission status: Runtime Error

Solution code:
N = int(input())

d = []
for _ in range(N):
  d.append(int(input()))

sm = 0
for i in range(N):
  sm += 1/d

print(1/sm)

Submission status: Runtime Error

Solution code:
a=input()
ans=0
n=list(map(int, input().split())
for i in n:
	ans += 1/i

print(1/ans)

Submission status: Runtime Error

Solution code:
a=int(input())
n=list(int,input().split())
ans=0
for i in n:
  ans += 1/i

print(1/ans)

Submission status: Runtime Error

Solution code:
N=int(input())
A=map(int,input().split())
s=sum(1/i) for i in A
t=1/s
print(t)

Submission status: Runtime Error

Solution code:
n = int(input())
a = map(int, input().split())
ans = 0
for i in range(n):
  ans += (1/a[i])
print(1/ans)

Submission status: Runtime Error

Solution code:
N = int(input())
lst_A = [1/int(input()) for i in range(N)]
#print('lst_A:', lst_A)
print(1/sum(lst_A))

Submission status: Runtime Error

Solution code:
#Resistors in Parallel
N = int(input())
lst_A = [1/int(input()) for i in range(N)]

print(1/sum(lst_A))

Submission status: Runtime Error

Solution code:
N = input()
lst_A = [1/int(input()) for i in range(N)]

print(1/sum(lst_A))

Submission status: Runtime Error

Solution code:
n=int(input())
b=0
for _ in range(n):
  b+=1/int(input())
print(1/b)

Submission status: Runtime Error

Solution code:
n = int(input())
a=[]
for i in range(n):
    a.append(int(input()))
b=0
for i in range(n):
   b = b + 1/a[i]
b=1/b
print(b)

Submission status: Runtime Error

Solution code:
N = int(input())
A_s = LI()

total = 0
for a in A_s:
  total+=(1/a)
  
print(1/total)

Submission status: Runtime Error

Solution code:
N=int(input())
A= list(map(int,input().split()))
s=0

for i in A:
    S+=1/i

print(1/S)

Submission status: Runtime Error

Solution code:
N=int(input())
A= list(map(int,input().split()))

for i in A:
    S+=1/A

print(1/S)

Submission status: Runtime Error

Solution code:
N=int(input())
A= list(map(int,input().split()))

for i in range(N):
    S+=1/A[i]

print(1/S)

Submission status: Runtime Error

Solution code:
N=int(input())
A= list(map(int,input().split()))

for i in A:
    S+=1/A[i]

print(1/S)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split(" ")))
for i in range(n):
  ans += 1/a[i]
print(1/ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(float ,input().split()))
sum=float(0)
for i in range(N)
	sum+=A[i]/(A[i]**2)
sum=sum**sum
print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
,l* = map(int,input().split())
inv=0
for i in l:
  inv += 1/i
print(1/inv)

Submission status: Runtime Error

Solution code:
N = int(intput())
L = list(map(int, input().split())
L_inv = [1/l for l in L]
print(1 / sum(L_inv))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in n:
    ans += 1 / i
print(1 / ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [1 / int(input()) for _ in range(n)]
print(1 / sum(a))

Submission status: Runtime Error

Solution code:
N=int(input())
A=map(int,input().split())
x=0
for i in range(N):
    x+=1/A[i]
x=1/x
print(x)

Submission status: Runtime Error

Solution code:
N = int(input())

A = [int(input()) for b in range(N)]
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)

Submission status: Runtime Error

Solution code:
N = int(input())

A = [int(input()) for _ in range(N)]
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)

Submission status: Runtime Error

Solution code:
N = int(input())

A = list(map(int, input().split()))
Ans = 0

for i in range(N):
    v += 1 / a[i]
print(1 / Ans)

Submission status: Runtime Error

Solution code:
def gcd(a, b):
    mi = min(a, b)
    ma = max(a, b)
    r = ma % mi
    if r == 0:
        return mi
    gcd(mi, r)


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

Sum = sum(A)
s = []
multi = 1.0
for t in A:
    multi = int((multi * t) / gcd(int(multi), int(t)))

for a in A:
    s.append(int(multi / a))

print(multi / sum(s))

Submission status: Runtime Error

Solution code:
import math

# not solved by myself
N = input()
A = list(map(int, input().split()))

Sum = sum(A)
s = []
multi = 1.0
for t in A:
    multi = int((multi * t) / math.gcd(int(multi), int(t)))

for a in A:
    s.append(int(multi / a))

print(multi / sum(s))

Submission status: Runtime Error

Solution code:
import numpy as np

# not solved by myself
N = input()
A = list(map(int, input().split()))

Sum = sum(A)
s = []
multi = 1
for t in A:
    multi = np.lcm(multi, t)

for a in A:
    s.append(int(multi / a))

print(multi / sum(s))

Submission status: Runtime Error

Solution code:
import numpy as np

# not solved by myself
N = input()
A = list(map(int, input().split()))

Sum = sum(A)
s = []
multi = np.lcm.reduce(A)
for a in A:
    s.append(int(multi / a))


print(int(multi / sum(s)))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
R = 0.0
for i in range(N):
  R += i**(-1)
print(1/R)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(1/(int,input().split())))
print(1/sum(a))

Submission status: Runtime Error

Solution code:
N = int(input())
A = map(int, input().split())
under = 0
for i in range(N):
    under += 1 / A[i]
print(1 / under)

Submission status: Runtime Error

Solution code:
ans = 0
for i in ai:
    ans=ans+1/i

print(1/ans)

Submission status: Runtime Error

Solution code:
n=list(map(int, input().split()))
def gyakusu():
  for i in range(len(n)):
    n[i]=1/n[i]
    return
gyakusu(n)
k=sum(n)
gyakusu(k)

Submission status: Runtime Error

Solution code:
n=list(map(int, input().split()))
def gyakusu():
  for i in range(len(n)):
    n[i]=1/n[i]
    return
gyakusu(n)
sum(n)
gyakusu(n)

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
s=0
for i in range(a):
  s+=1/i
print(1/s)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define INF 1145141919
#define LLINF 1145148101919
#define PI 3.14159265359
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int ny, nx;
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

ll llpow(ll x, ll y)
{
    ll ans = 1;
    REP(i, y)
    ans *= x;
    return ans;
}

int ctoi(char c)
{
    if (c >= '0' && c <= '9')
    {
        return c - '0';
    }
    return 0;
}

class UnionFind
{
public:
    vector<ll> par; // 各元の親を表す配列
    vector<ll> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL)
    {
        for (ll i = 0; i < sz_; ++i)
            par[i] = i; // 初期では親は自分自身
    }
    void init(ll sz_)
    {
        siz.assign(sz_, 1LL); // assign: 再代入
        par.resize(sz_);      // resize: 再確保
        for (ll i = 0; i < sz_; ++i)
            par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x)
    { // 根の検索
        while (par[x] != x)
        {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y)
    {
        x = root(x);
        y = root(y);
        if (x == y)
            return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y])
            swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y)
    { // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x)
    { // 素集合のサイズ
        return siz[root(x)];
    }
};

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename Container>
bool exist_in(const Container &c, const typename Container::value_type &v)
{
    return (c.end() != std::find(c.begin(), c.end(), v));
}

vector<ll> decom;

void decompositPrime(ll n)
{
    ll a = 2;
    while (n >= a * a)
    {
        if (n % a == 0)
        {
            decom.push_back(a);
            n /= a;
        }
        else
        {
            a++;
        }
    }
    decom.push_back(n);
}

string S, T;
int ctoi_alpha(char c)
{
    if (c >= 'a' && c <= 'z')
    {
        return c - 'a';
    }
    return 0;
}

////////////////////////////////////////

int main()
{
    double N; cin >> N;
    vector<double> A(N);
    REP(i,N) cin >> A[i];

    vector<double> inv(N);
    REP(i,N) inv[i] = 1/A[i];
    double ans;
    REP(i,N){
        ans += inv[i];
    }

    std::cout << std::defaultfloat << std::setprecision(10);

    cout << 1/ans << endl;

}

Submission status: Runtime Error

Solution code:
N = int(input())
A =map(int,input().split())
sum=0
for i in range(N):
  sum+=1/A[i]
print(1/sum)

Submission status: Runtime Error

Solution code:
n = input()
an = list(map(int, input().split()))
i=0
k=0
 
 

  
while n>i:
  k+=1/an[i]
  i+=1
  
print(1/k)

Submission status: Runtime Error

Solution code:
n=int(input())
s=[int(input()) for i in range(n)]
i=0
k=0
 
 

  
while n>i:
  k+=1/s[i]
  i+1
  
print(1/k)

Submission status: Runtime Error

Solution code:
n=int(input())
s=[input() for i in range(n)]
i=0
k=0
 
 

  
while n>i:
  k+=1/s[i]
  i+1
  
print(1/k)

Submission status: Runtime Error

Solution code:
n=int(input())

i=1
k=0

while n>=i:
  f[i]=int(input())
  i+=1
  
while n>=i:
  k+=1/f[i]
  i+1
  
print(1/k)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split(" ")))

for i in range(N):
  sum += 1 / A[i]
print(1/sum)

Submission status: Runtime Error

Solution code:
v

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input()))

preans=0

for i in range(N):
    preans+=1/A[i]

print(1/preans)

Submission status: Runtime Error

Solution code:
c=0;a=input();for i in input().split():
  c+=1/int(i)
print(1/c)

Submission status: Runtime Error

Solution code:
n=input()
m=input()

for i in n:
  a+=1/m[i]

answer=1/a
print(answer)

Submission status: Runtime Error

Solution code:
n=input()
m=input()
length=len(m)

for i in length:
  a+=1/i

answer=1/a
print(answer)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(x) for x in input().split()]
c=0
for i in range(n):
  c+=1//a[i]
print(1//c)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(x) for x in input().split()]
c=0
for i in range(n):
  c+=1//i
print(1//c)

Submission status: Runtime Error

Solution code:
sum = 0
N = input() 
for i in range(int(N)):
	s = float(input())
	sum = sum+(1/s)
print(sum)

Submission status: Runtime Error

Solution code:
sum = 0
N = input() 
for i in range(N):
	s = input()
	sum += 1/s
print(sum)

Submission status: Runtime Error

Solution code:
int N
float sum = 0
N = input() 
for i in range(N)
	s = input()
	sum = (float)1/s
print(sum)

Submission status: Runtime Error

Solution code:
int N
float sum = 0
N = input() 
for i in N
	s = input()
	sum = (float)1/s
print(sum)

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
sum=0
for i in range(n):
  sum = sum + 1/data[i]
print(1/sum)

Submission status: Runtime Error

Solution code:
n=int(input())
data = [input() for i in range(n)]
sum=0
for i in range(n):
  sum = sum + 1/data[i]
print(1/sum)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
import numpy as np
A = np.array(A)
1_A = 1/A
print(1/np.sum(1_A))

Submission status: Runtime Error

Solution code:
N=float(input(""))
v = 0
for i in range(N):
    A=float(input(""))
    v = v + 1/A

print(1/v)

Submission status: Runtime Error

Solution code:
N=int(input(""))
v = 0
for i in range(N):
    A=int(input(""))
    v = v + 1/A

print(1/v)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input()))

top = 1
for a in A:
    top = top * a

bottom = 0
for i in range(N):
    bottom += top / A[i]

ans = top / bottom
print(round(ans, 6))

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input()))

top = 1
for a in A:
    top = top * a

bottom = 0
for i in range(N):
    bottom += top / A[i]

ans = top / bottom
print(ans)

Submission status: Runtime Error

Solution code:
#N = int(input())
#A = list(map(int, input()))

top = 1
for a in A:
    top = top * a

bottom = 0
for i in range(N):
    bottom += top / A[i]

ans = top / bottom
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
  S += 1 / A[i]

ans = 1 / S
print('[:.6g]'.format(ans))