Skip to content

Instantly share code, notes, and snippets.

@sbsatter
Created June 7, 2019 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbsatter/ca3240ae404ee7f7adc30898cc8cdd7f to your computer and use it in GitHub Desktop.
Save sbsatter/ca3240ae404ee7f7adc30898cc8cdd7f to your computer and use it in GitHub Desktop.
# Enter your code here. Read input from STDIN. Print output to STDOUT
n = int(input())
arr = list(map(int, input().split()))
w = list(map(int, input().split()))
s = 0
for i in range(n):
s = s + arr[i] * w[i]
s /= sum(w)
print(round(s, 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment