Given $n$ polynomials $A_1, A_2, .. A_n$with the same degree $M$.
$A_i = \prod_{j=0}^M(1+Q_{ij}x)$.
In their root form $Q$, $Q_{ij} \in \mathbb{R}$. And the function, I'm interested in, $B$ is a weighted sum of $A_i$ with weight $w_i$.
$B = \sum_{i=1}^n w_iA_i$.
$B$ also has it's root form denote $B=\prod_{k=0}^n(1+C_kx)$.
My question is how can I get $C$ efficiently given $Q$ and $w$?