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:
def main():
  N = int(input())
  A = list(map(int,input().split()))

  tmp = 0
  for a in A:
    tmp += 1/a
  print(1/tmp)

main()

Submission status: Accepted

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

Submission status: Accepted

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

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()))

count = 0

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

print(1/count)

Submission status: Accepted

Solution code:
from fractions import gcd
import math

mod = 1000000007


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


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

Submission status: Accepted

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

cnt=0
for i in range(s):
    cnt+=1/a[i]

print(1/cnt)

Submission status: Accepted

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

b = 0.0
for a in A:
    b += 1/a
print(1.0 / b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(1/total)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
a_list=list(map(int,input().split()))
bunbo=0
for i in a_list:
    bunbo+=1/i
print(1/bunbo)

Submission status: Accepted

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

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

print(1/r)

Submission status: Accepted

Solution code:
# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
# As = [int(i) for i in input().split(" ")]
# Ss = ["".join(sorted(input())) for _ in range(N)]
# from math import factorial
# def nCr(n, r): return factorial(n) // factorial(r) // factorial(n - r)

N = int(input())
As = [int(i) for i in input().split(" ")]

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

Submission status: Accepted

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

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:
n = int(input())
a = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
import sys

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

    ans = 0.0
    bunbo = 0.0
    for a in A:
        bunbo += (1.0/a)
    ans = 1 / bunbo
    print(ans)

if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
p = 1
for i in A:
    p *= i
d = 0
for i in A:
    d += p // i
print(p / d)

Submission status: Accepted

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

s=0
for e in a:
  s += 1 / e
  
print(1/s)

Submission status: Accepted

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

if __name__ == '__main__':
    s = 1.0 / sum(1.0 / ai for ai in a)
    print(s)

Submission status: Accepted

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

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

mul = A[0]
for i in range(1, N) :
    mul *= A[i]

s = 0
for i in range(N) :
    s += mul // A[i]

print(mul / s)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
import math
import copy
from operator import mul
from functools import reduce
from collections import defaultdict
from collections import Counter
from collections import deque
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
# 一次元累積和
from itertools import accumulate
from bisect import bisect_left, bisect_right
from heapq import heappush, heappop

import re
# import numpy as np
from scipy.misc import comb

# 再帰がやばいとき
# import sys
# sys.setrecursionlimit(10**9)

def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

# 四方向: 右, 下, 左, 上
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
 
def i_inpl(): return int(input())
def l_inpl(): return list(map(int, input().split()))
def line_inpl(x): return [i_inpl() for _ in range(x)]

INF = int(1e30)
MOD = int(1e9)+7 # 10^9 + 7

# field[H][W]
def create_grid(H, W, value = 0):
    return [[ value for _ in range(W)] for _ in range(H)]

########

def main():
    # a = i_inpl()
    # s = input()

    # if 3200 <= a:
    #     print(s)
    # else:
    #     print("red")
    N = i_inpl()
    A = l_inpl()

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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


res = 0
for a in a_list:
    res += 1/a
print(1/res)

Submission status: Accepted

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

r = float(0)
e = float(1)
for a in As:
    r += e / a
print(1 / r)

Submission status: Accepted

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

Submission status: Accepted

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

B = 1
for a in A:
    B *= a
C = 0
for a in A:
    C += (B//a)
print(B/C)

Submission status: Accepted

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

Submission status: Accepted

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

sums=0
for i in s:
    sums += 1/i

print(1/sums)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sum = 0
index=0
while index < len(listA):
    sum+=(1/listA[index])
    index+=1
print(1/sum)

Submission status: Accepted

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


tmp = 0
for ai in A:
    tmp += 1 / ai

ans = 1 / tmp
print(ans)

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:
n=int(input())
a=list(map(int,input().split()))

div=0

for i in range(n):
    div+=(1.0/a[i])

ans=1.0/div

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    N = INT()
    A = LIST()
    sum = 0
    for aa in A:
        sum += 1/aa
    print(1/sum)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

N = int(input().strip())
As = list(map(int, input().strip().split(' ')))

b = sum(1/a for a in As)
print(1/b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections, copy, heapq


def solve(N: int, A: "List[int]"):
    A = [1/a for a in A]
    s = 1/sum(A)
    print('%.10f' % s)
    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=[int(x) for x in input().split()]
print(1/sum([1/x for x in a_list]))

Submission status: Accepted

Solution code:
import sys

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

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

    return 1/ans


if __name__ == '__main__':
    print(main())

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 = [ int(i) for i in input().split() ]

do = 0.0
for i in a:
    do += (1/i)

print( 1/do )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

bunbo = 0
for a in a_list:
    bunbo += 1/a

print(1/bunbo)

Submission status: Accepted

Solution code:
n = int(input())

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

ans = 0

for i in range(n):
    ans += 1/li[i]
    
print(1/ans)

Submission status: Accepted

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

print(1/b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = map(int, input().split())
print(1.0 / sum([ 1.0 / a for a in 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:
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:
# coding: utf-8

import sys
import math
import collections
import itertools
def input(): return sys.stdin.readline().strip()
def gcd(x, y): return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y): return (x * y) // gcd(x, y)
MOD = 10 **9 + 7

N = int(input())
# S = input()
# N, M = map(int, input().split())
# 横
A = [int(x) for x in input().split()]
# 縦
# A = [int(input()) for _ in range(N)]
# 多次元
# L = [[int(x) for x in input().split()] for _ in range(N)]

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()))
d=0
for i in range(n):
	d+=1/a[i]
print(1/d)

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n = int(input())
aaa = get_nums_l()

sum_rev = sum(map(lambda a: 1/a, aaa))
print(1/sum_rev)

Submission status: Accepted

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

Submission status: Accepted

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

B = 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()))

res = 0
sum1 = 0
for a in A:
    sum1 += 1/a

res = 1/sum1
print(res)

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:
# ABC138
def main():
    N = int(input())
    A = tuple(map(int, input().split()))
    x = sum(1 / i for i in A)
    print(1 / x)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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:
import sys
input = sys.stdin.readline

A = int(input())
L = [1/int(v) for v in input().split()]

print(1/sum(L))

Submission status: Accepted

Solution code:

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

val = 0
for a in A:
    val += 1/a
print(1/val)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#

import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop

def main():
    n = int(input())
    al = list(map(int, input().split()))
    su = sum([1/a for a in al])
    print(1/su)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
n = n[0]
m = list(map(int, input().split()))

ans = 0

for i in range(n):
    ans += 1/m[i]
    
print(1/ans)

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:
N = int(input())
nums = list(map(int, input().split()))

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

Submission status: Accepted

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

inv = []
for i in range(n):
    inv.append(1 / lst[i])
print(1 / sum(inv))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
n=int(input())
alist = list(map(int, input().split()))
kazu=0
for i in range(n):
    kazu+=(1/alist[i])

print(1/kazu)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

As = [1 / a for a in A]

print(1 / sum(As))

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:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    # N, K = map(int, input().split())
    a = list(map(int, input().split()))
    # s = input().strip()
    ans = 0
    for i in range(N):
        ans += 1/a[i]
    ans = 1/ans
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
a = list(li())
bunbo = 0
for ai in a:
    bunbo += 1/ai

print(1/bunbo)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  l=LI()

  sm=0
  for x in l:
    sm+=1/x

  return 1/sm

# main()
print(main())

Submission status: Accepted

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

Submission status: Accepted

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

print(1/sum(map(lambda x: 1/x, A)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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



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

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

Submission status: Accepted

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

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:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def perr(s): return print(s, file=sys.stderr)

N = _I()
A = LI()

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

print(1/ans)

Submission status: Accepted

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

ans = sum([1/A for A in As])
print(1/ans)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i) for i in 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()))
X = sum([1 / a for a in A])
print(1 / X)

Submission status: Accepted

Solution code:
import math
import fractions
import copy
import numpy as np
import heapq
def j(q):
    if q==1: print("Yes")
    elif q == 0:print("No")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def printrow(a):
    for i in a:
        print(i)
"""
#decomment when needed
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
"""
n = ip()
a = iprow()
s = 0
for i in range(n):
    s+=(1/a[i])
print(1/s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

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

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

N = int(sys.stdin.readline())
A = list(map(Decimal, sys.stdin.readline().split()))


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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

n = int(input())
a = [int(i) for i in readline().split()]


ans = sum(1/i for i in a)

print(1/ans)

Submission status: Accepted

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

S = 0
for i in A:
    S += 1/i
S = 1/S

print(S)

Submission status: Accepted

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

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:
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:
n = int(input())
a = [int(i) for i in input().split()]
ans = 0
for aa in a:
    ans += 1 / aa
print(1/ans)

Submission status: Accepted

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

ret = [1.0/ai for ai in a]

print(1.0/sum(ret))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(1/a_sum)

Submission status: Accepted

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

s  = 0
for num in a:
    s += 1/num
    
print(1/s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()
AA = inpl()
b = 0
s = 1
X = 1
for a in AA:
    X *= a

for a in AA:
    tmp = X//a
    b += tmp

print(X/b)

Submission status: Accepted

Solution code:


n = int(input())
num_list = [ int(v) for v in input().split() ]
num_list = [ 1/i for i in num_list ]

print(1/sum(num_list))

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()))
x=0
for b in a:
    x+=1/b
print(1/x)

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())
a = list(map(int, input().split()))


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

Submission status: Accepted

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

d = [1.0 / ai for ai in a]
print(1.0 / sum(d))

Submission status: Accepted

Solution code:
n = int(input())
num = [int(_) for _ in input().split()]
div = 0
for i in range(n):
    div += 1 / num[i]
print(1/div)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

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

print(1/temp)

Submission status: Accepted

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

Submission status: Accepted

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