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:
n = int(input())

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

sm = 0
for i in a:
	sm += 1.0/i

sm = 1.0/sm

print(sm)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
*A, = map(int, input().split())
s = 1
for i in range(N):
    s *= A[i]
t = 0
for i in range(N):
    t += s // A[i]
print("%.16f" % (s/t))

Submission status: Accepted

Solution code:
N = int(input())

a_list = list(map(lambda x:int(x),input().split(" ")))
inv_a = 0

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

print(1/inv_a)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
answer = 1.0 / sum([1.0 / ai for ai in a])
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

    denominator = 0

    for i in a:
        denominator += 1 / i
    
    print(1 / denominator)

if __name__ == '__main__':
    abc138_b()

Submission status: Accepted

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

print(1 / ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip

from functools import reduce


def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x


def extended_gcd(a, b):
    """returns gcd(a, b), s, r s.t. a * s + b * r == gcd(a, b)"""
    s, old_s = 0, 1
    r, old_r = b, a
    while r:
        q = old_r // r
        old_r, r = r, old_r - q * r
        old_s, s = s, old_s - q * s
    return old_r, old_s, (old_r - old_s * a) // b if b else 0


gcdm = lambda *args: reduce(gcd, args, 0)

lcm = lambda a, b: a * b // gcd(a, b)

lcmm = lambda *args: reduce(lcm, args, 1)


def main():
    n = int(input())
    a = [int(i) for i in input().split()]

    l = lcmm(*a)

    print(l / sum(l // i for i in a))


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys;
import string;
sys.setrecursionlimit(20000) # 再起呼び出しの最大数をセット

import copy
import math
import itertools

from functools import lru_cache
#@lru_cache(maxsize = None)

PPP = 1000000007

# 整数の入力
n = int(input())
#s = input()

# スペース区切りの入力
#n, x = input().split()

# スペース区切りの整数の入力
#a, b = map(int, input().split())
#n, x = map(int, input().split())
#print("sp", n, k, file=sys.stderr)
a = [int(x) for x in input().split()]
#b = [int(x) for x in input().split()]
#print("a", a, file=sys.stderr)
#p, q, r = map(int, input().split())
#s = [int(x) for x in input().split()]
#t = [int(x) for x in input().split()]

# 改行区切りの整数の入力
#a = []
#for x in range(n):
#  a.append(int(input()))
#  a.append([int(x) for x in input().split()])
#b = []
#for x in range(m):
#  b.append([int(x) for x in input().split()])
#p = [int(x) for x in input().split()]
#a.sort()
#print(l, file=sys.stderr)

# 文字列の入力
#s = input()

# 出力
#print("{} {}".format(a+b+c, s))
#a.sort()
#print(set(a), file=sys.stderr)
#print(len(set(a)))

#cache = dict()

import re
import fractions

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

def ton(n, k, x):
  s = ""
  while n > 0:
    s = str(n%k) + s
    n //= k
  return s


#print("a", a, file=sys.stderr)
#print("b", b, file=sys.stderr)

def getEnergy():
  for y in b:
    yield y

  #print(res, file=sys.stderr)
  return res

def doit():
  ret = 0.0
  for x in a:
    ret += 1.0 / x
  return 1.0 / ret

def yn():
  if doit():
    return "YES"
  else:
    return "NO"

#print(doit([0] * 4))
#doit(a)
#print(doit())
try:
  #doit()
  print(doit())
  #print(yn())
except Exception as e:
  print("e", e, file=sys.stderr)

Submission status: Accepted

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

tmp = 0
for i in a:
    tmp += 1 / i

print(1 / tmp)

Submission status: Accepted

Solution code:
n=int(input())
lista=map(int,input().split())
b=sum(1/i for i in lista)
print(1/b)

Submission status: Accepted

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

for i in A:
    ans+=(1/i)
print(1/ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
list1 = [1/x for x in A]
sum1 = sum(list1)
ans = 1/sum1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
number = int(input())
input_a_list = list(map(int, input().split()))
tmp_sum = 0

for a in input_a_list:
    tmp_sum += 1/a

print(1/tmp_sum)

Submission status: Accepted

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

print(1/tmp)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
A = np.array([float(v) for v in input().split()])

print(1.0 / sum(1.0 / A))

Submission status: Accepted

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: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))
sum = 0

for i in range(N):
  sum = 1/a[i]+sum
res = 1/sum

print("{}".format(res))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = int(input())

result = 0.0
nums = input().split()

for num in range(a):
  result += 1/ int(nums[num])

print(1/result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
input()
print(1 / sum(1 / int(x) for x in input().split()))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
arr = [int(x) for x in input().split()]
s = 0
for x in arr:
    s += 1/x
print(1/s)

Submission status: Accepted

Solution code:
N=int(input())
A_s=list(map(int,input().split()))
fracts=list(map(lambda x:1/x,A_s))
print(1/sum(fracts))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
v_array = sorted([int(x) for x in input().split()])
now =0
for i in v_array:
    now += 1/i
print(1/now)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
num = [int(i) for i in input().split()]

inv = [1/i for i in num]

sum = 0
for i in inv:
	sum += i

print(1/sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8


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

    mul = 1
    for Ai in A:
        mul *= Ai

    mulA = []
    sumA = 0
    for Ai in A:
        temp = mul/Ai
        mulA.append(mul/Ai)
        sumA += temp

    ans = mul/sumA
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys 
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()
a = na()
bunbo = 0
for ai in a:
     bunbo += 1/ai
print(1/bunbo)

Submission status: Accepted

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

print(1/s)

Submission status: Accepted

Solution code:
import decimal


n = int(input())
As = list(map(lambda x: decimal.Decimal(int(x)), input().split()))
As_inv = list(map(lambda x: decimal.Decimal(1) / x, As))
print(decimal.Decimal(1) / sum(As_inv))

Submission status: Accepted

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

print(1 / sum([1/ a for a in A]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(s) for s in input().split()]
    print(1 / sum(1 / a for a in A))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(1 / sum(1 / x for x in a))

Submission status: Accepted

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

print(1/sum)

Submission status: Accepted

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

sigma = 0
for i in range(n):
    sigma += 1/(a[i])
print(1/sigma)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#ABC138B
import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

total=1
for i in range(0,n):
	total*=hoge[i]

ret=0
for i in range(0,n):
	ret+=total/hoge[i]

print(total/ret)

Submission status: Accepted

Solution code:

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

power = 1
for n in range(len(A)):
	power *= A[n]
sum = 0
for n in range(len(A)):
	sum += power/A[n]

print(power/sum)

Submission status: Accepted

Solution code:
a=[]
b=int(input())
c=0
for x in input().split(" "):
    a.append(int(x))

for x in a:
    c+=1/x
print(1/c)

Submission status: Accepted

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

for i in A:
    ans += 1/i

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

aux = 0.0

for i in arr:
    aux += 1.0/i

aux = 1/aux

print(aux)

Submission status: Accepted

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

m = 1
for i in ls:
  m*=i

j =0
for i in ls:
  j += m/i
print(m/j)

Submission status: Accepted

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

arr = []
for i in a:
    arr.append(1 / i)

print(1 / sum(arr))

Submission status: Accepted

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

A_inv = [1/x for x in A]
A_sum = sum(A_inv)
print(1/A_sum)

Submission status: Accepted

Solution code:


N = int(input())

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

head = 0

for i in A:

    head += 1 / i

print (1 / head)

Submission status: Accepted

Solution code:
N = int(input())

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

low = 0
for i in range(N):
  low += 1 / lst[i]

print(1 / low)

Submission status: Accepted

Solution code:
import numpy as np

N=int(input())
A=np.array(input().split(),dtype=np.int32)

S=0
for a in A:
    S+=1.0/a

print(1.0/S)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=0
L=list(map(int,input().split()))
#a,b=map(int,input().split())
#A=[[0 for i in range()] for j in range()]
#l = [int(input()) for i in range(N)]

for i in range(n):
  s+=1/L[i]
  
print(1/s)

Submission status: Accepted

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

k = [ans/a[i] for i in range(n)]
ans /=sum(k)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
A_inv = [1/a for a in A]
print(1/sum(A_inv))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    ans = sum([1/i for i in A])
    print(1/ans)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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()))

k = 0
for i in range(n):
    k+=(1/a[i])

print(1/k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
box1 = [int(s) for s in input().split()]
box = []
for i in box1:
  box.append(1/i)
print(1/sum(box))

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

for a in A:
    A_gyakusu.append(1/a)

print(1/sum(A_gyakusu))

Submission status: Accepted

Solution code:
def main():
  n=int(input())
  a=list(map(int,input().split()))
  total=0
  for i in range(n):
    total+=1/a[i]
    
  print(1/total)  
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
a_list = input().split()
r_sum = 0
for a in a_list:
    fa = float(a)
    r_sum += 1.0 / fa
print(1.0 / r_sum)

Submission status: Accepted

Solution code:
from fractions import Fraction

n = int(input())

inputs = [int(i) for i in raw_input().split()]

print(float(Fraction(1, sum([Fraction(1, x) for x in inputs]))))

Submission status: Accepted

Solution code:
N = int(input())
A = input().split()
Ad = [1/int(i) for i in A]
b=0
for i in Ad:
  b=b+i
print(1/b)

Submission status: Accepted

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

Submission status: Accepted

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

s, m = 0, 1
for a in A:
    s += 1.0/a

print(1/s)

Submission status: Accepted

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

print(1/ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from scipy import stats
import sys
def main():
    input = sys.stdin.readline
    n = int(input())
    As = list(map(int, input().split()))

    """
    ansinv = 0
    for i in range(n):
        ansinv += 1 / as[i]

    ans = 1 / ansinv
    """
    ans = stats.hmean(As) / n
    print(ans)
 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ua = 0

for a in A:
    ua += (1/a)

print(1/ua)

Submission status: Accepted

Solution code:
def solve(N, As):
    m = 1
    for a in As:
        m *= a
    k = 0
    for a in As:
        k += m / a
    return m / k

if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N, As))

Submission status: Accepted

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

ue = 1
for i in A:
    ue *= i

shita = 0
for i in range(N):
    tmp = 1
    for j in range(N):
        if i == j: continue
        tmp *= A[j]
    shita += tmp

print(ue/shita)

Submission status: Accepted

Solution code:
def main():
    n= int(input())
    ls = [int(x) for x in input().split()]
    bunsi = 1
    for i in range(n):
        bunsi *= ls[i]
    bunbo = 0

    for i in range(n):
        bunbo += bunsi/ls[i]
    print(bunsi/bunbo)

if __name__ =="__main__":
    main()

Submission status: Accepted

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

def gyaku(num):
  return 1 / num
bunbo = 0
for i in range(n):
  bunbo += gyaku(A[i])
print(1 / bunbo)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))

r = 0
for i in a:
    r += 1 / i

print(1/r)

Submission status: Accepted

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

ans = float(1/ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  Nums = int(input())
  numbersList = map(int,input().split())
  
  sum_inv = sum((1.0/num for num in numbersList))

  print(1.0/sum_inv)

if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

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

r = 0
for a in A:
    r += 1 / a

result = 1 / r

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

print(1/B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
ans = 0
for a in A:
    ans += 1/a
print(1/ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
n = int(input())
a = input().split()
sp = 0
for r in a:
    r = int(r)
    sp += (1 / r)
print(1 / sp)

Submission status: Accepted

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

bunbo = 0
for i in range(n):
	bunbo += (1/a[i])

print(1/bunbo)

Submission status: Accepted

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

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

Submission status: Accepted

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

gyaku_A=0
for a in A:
    gyaku_A+=1/a
    
ans=1/gyaku_A

print(str(ans))

Submission status: Accepted

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

sum = 0
for i in args:
    sum = sum + 1/i

print(1/sum)

Submission status: Accepted

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

# In[ ]:


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


# In[ ]:


sum_ = 0
for n in A:
    sum_ += 1/n
print(1/sum_)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

print(1/mother)

Submission status: Accepted

Solution code:
num = int(input())
list = input().split()
goukei = 0
for i in range(num):
  goukei = goukei + (1/int(list[i]))

print(1/goukei)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

# output
print(1 / ans)

Submission status: Accepted

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

r = 0
for b in a:
  r = r + 1/b

print(1/r)

Submission status: Accepted

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

print(1/sum([1/x for x in a]))

Submission status: Accepted

Solution code:
N=int(input())
A=map(int, input().split())
Ainv=[1.0/float(a) for a in A]
Ainvsum=sum(Ainv)
print("{}".format(1.0/Ainvsum))

Submission status: Accepted

Solution code:
def calc_reverse(n):
    return n ** (-1)

n = int(input())
a = [int(inp) for inp in input().split()]
*a, = map(calc_reverse, a)
print(sum(a) ** (-1))

Submission status: Accepted

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

reverse_A = []
for i in range(N):
  reverse_A.append(1/A[i])

print(1/sum(reverse_A))

Submission status: Accepted

Solution code:
N = int(input())

A = [int(i) for i in input().split()]
sum = 0
for a in A:
    sum += 1 / a

print(1/sum)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

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

A = [1 / x for x in A]

print(1/sum(A))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    _ = int(stdin.readline().rstrip())
    As = [int(x) for x in stdin.readline().rstrip().split()]
    sum_ = sum([1 / x for x in As])
    print(1 / sum_)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

denomi = 0
for a in al:
    denomi += 1/a

print(1/denomi)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(lambda x: 1 / int(x), input().split()))
print(1 / sum(A))

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    res = 0

    for i in range(n):
        res += 1 / a[i]

    print(1/res)
resolve()

Submission status: Accepted

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

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

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
aaa = na()
m = 1
for a in aaa:
    m *= a
s= 0
for a in aaa:
    s += (m/a)
print(m/s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in a:
    a2+=1/i

print(1/a2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n1 = int(input())

n2 = [int(i) for i in input().split()]

t1 = 0

for i1 in range(n1):
    t1 += 1 / n2[i1]

r1 = 1 / t1

print(r1)

Submission status: Accepted

Solution code:
n = int(input())
print(1.0/sum([1.0/float(i) for i in input().split()]))

Submission status: Accepted

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

sum=0

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

Submission status: Accepted

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

reverse_list = []

for A in As:
    reverse_list.append(1/A)

print(1/sum(reverse_list))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

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

a = [1/i for i in a]

a = 1/sum(a)

print(a)

Submission status: Accepted

Solution code:
def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    buf = 0
    for d in a:
        buf += 1 / d
    return 1 / buf


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

import sys
input = sys.stdin.readline


def main():
    n = int(input())
    a = list()

    for i in map(int, input().split()):
        a.append(i)

    tmp = 0
    for i in a:
        tmp += 1 / i

    print(1 / tmp)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import fsum
N=int(input())
A=[int(x) for x in input().split()]
print(1/fsum(1/a for a in A))

Submission status: Accepted

Solution code:
def main():
    _ = int(input())
    A = [int(x) for x in input().split()]
    ans = 0.0
    for a in A:
        ans += (1 / a)
    
    print(1 / ans)

if __name__ == "__main__":
    main()