Problem: 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}}.

Submission attempts (in order):
N = int(input())
A = []
for i in range(0,N):
  B = int(input())
  A.append(B)

sum1 = float(1/A[0])

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

result = 1/sum1
print(result)

try:
    N = int(input())
    if N>0 or N<=100:
        A = []
        for i in range(0,N):
          B = int(input())
          if B>0 or B<=1000:
              A.append(B)
 
        sum1 = 1/A[0]
 
        for i in range(0,N-1):
         sum1 = sum1 + 1/A[i+1]
 
        result = 1/sum1
        print(result)
 
except:
        print("Error")

while True:
    try:
        N = int(input())
        if N>0 or N<=100:
            A = []
            for i in range(0,N):
              B = int(input())
              if B>0 or B<=100:
                  A.append(B)

            sum1 = 1/A[0]

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

            result = 1/sum1
            print(result)

            break

    except:
            print("Error")

try:
    N = int(input())
    if N>0 or N<=100:
        A = []
        for i in range(0,N):
          B = int(input())
          if B>0 or B<=100:
              A.append(B)
 
        sum1 = 1/A[0]
 
        for i in range(0,N-1):
         sum1 = sum1 + 1/A[i+1]
 
        result = 1/sum1
        print(result)
 
except:
        print("Error")

N = int(input())
if N>0 or N<=100:
    A = []
    for i in range(0,N):
      B = int(input())
      if B>0 or B<=1000:
          A.append(B)
 
    sum1 = 1/A[0]
 
    for i in range(0,N-1):
      sum1 = sum1 + 1/A[i+1]
 
    result = int(1/sum1)
    print(result)

N = int(input())
if N>0 or N<=100:
    A = []
    for i in range(0,N):
      B = int(input())
      if B>0 or B<=1000:
          A.append(B)
      else:
          break
 
    sum1 = 1/A[0]
 
    for i in range(0,N-1):
      sum1 = sum1 + 1/A[i+1]
 
    result = int(1/sum1)
    print(result)

while True:
    try:
        N = int(input())
        if N>0 or N<=100:
            A = []
            for i in range(0,N):
              B = int(input())
              if B>0 or B<=100:
                  A.append(B)

            sum1 = float(1/A[0])

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

            result = 1/sum1
            print(result)

            break

    except:
            print("Error")

N = int(input())
A = []
for i in range(0,N):
  B = int(input())
  A.append(B)

sum1 = float(1/A[0])

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

result = 1/sum1
print(result)

while True:
    try:
        N = int(input())
        A = []
        for i in range(0,N):
          B = int(input())
          A.append(B)

        sum1 = float(1/A[0])

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

        result = 1/sum1
        print(result)

        break

    except:
        print("Error")

try:
    N = int(input())
    if N>0 or N<=100:
        A = []
        for i in range(0,N):
          B = int(input())
          if B>0 or B<=100:
              A.append(B)
 
        sum1 = 1/A[0]
 
        for i in range(0,N-1):
         sum1 = sum1 + 1/A[i+1]
 
        result = 1/sum1
        print(result)
 
except:
        print("Error")

N = int(input())
if N>0 or N<=100:
    A = []
    for i in range(0,N):
      B = int(input())
      if B>0 or B<=100:
          A.append(B)
 
    sum1 = 1/A[0]
 
    for i in range(0,N-1):
      sum1 = sum1 + 1/A[i+1]
 
    result = 1/sum1
    print(result)

try:
    N = int(input())
    if N>0 or N<=100:
        S = input()
        A = S.split()
        A = list(map(int, A)) 
 
        sum1 = 1/A[0]
 
        for i in range(0,N-1):
         sum1 = sum1 + 1/A[i+1]
 
        result = 1/sum1
        print(result)

except:
        print("Error")

Verdicts: Runtime Error

Wrong Answer

Time Limit Exceeded

Wrong Answer

Runtime Error

Runtime Error

Time Limit Exceeded

Runtime Error

Time Limit Exceeded

Wrong Answer

Runtime Error

Accepted