URI Online Judge Solution | 1006 Average 2

Problem:
https://www.urionlinejudge.com.br/judge/en/problems/view/1006

Solution:

It also use weighted average/mean
You can check this link for weighted mean   http://www.mathsisfun.com/data/weighted-mean.html

Weighted Mean =   Σwx
Σw