# Weighted Mean

Given a discrete set of numbers, $$X$$, and a corresponding set of weights, $$W$$, the *weighted mean* is calculated as follows: $$m\_w = \frac{\sum\_{i=1}^n (x\_i \* w\_i)}{\sum\_{i=1}^n w\_i}$$, where $$x\_i$$ and $$w\_i$$ are the respective $$i^{th}$$ corresponding elements of $$X$$ and $$W$$.

For example, if $$X = {1, 3, 5}$$and $$W={2, 4, 6}$$, our weighted mean would be:

$$m\_w = \frac{(1*2)+(3*4)+(5\*6)}{2 + 4 + 6}=\frac{2+12+30}{12}=3.\bar{66}$$

If we wanted to round this to a scale of  decimal place, our result would be .&#x20;

```
num = int(input())
values = list(map(int, input().split()))
weights = list(map(int, input().split()))

v = list(map(lambda x, y: x*y, values, weights))
wmean= sum(v)/sum(weights)

print('%.1f' % wmean)
```
