think about when you're computing a weighted average: you do something like
W = sum(amount*weight) / sum(weight)
Now I need to find every amount (amount0, amount1.....) starting from knowing the value of W and every single weight. Is this possible? I'm trying to find out an algorithm.
Thanks in advance