Assume two $n \times n$ matrices $A$ and $B$ are known before hand and any precomputation can be done on them. Is there an efficient way to solve a set of linear problems: $$ \begin{split} (A+w_1 B) x_1 &= y_1, \\ (A+w_2 B) x_2 &= y_2, \\ &\vdots \end{split} $$ where $w_1, w_2, \dotsc$ are diagonal matrices (weights of a set of constraints), $x_1, x_2, \dotsc$ are unknown vectors and $y_1, y_2, \dotsc$ are right hand side vectors.

If $w_1 = w_2 = \dotsb = w$, then we can LU decompose $A+w B$ and simply solve for all $x_i$. Now the problem is that $w_1, w_2, \dotsc$ are different. So do I have to solve each problem individually or is there a more efficient way?