1711  Random at Random
Time Limit : 1 Second
Memory Limit : 128 MB
Submission: 8
Solved: 4
 Description
Xiao Hua is a student who loves running. However, he is too fat to run fast.
As a straight A student of science and engineering, Xiao Hua developed a runninghelper one day to accelerate himself while running. He called it the HKJA(Hong Kong Journalist Accelerator).
The HKJA’s operating mechanism is as follows: each acceleration contains n independent sections (where n is a nonnegative random variable). Its expectation is μ_{n} and the variance is σ_{n}^{2 }. During the i^{th} independent accelerationsection, the HKJA gives the user a velocity increment values a_{i}(where a_{i}~N(μ_{a}.σ_{a}^{2}) ). All the a_{i }is in i.i.d.(independent identical distribution). The result of the final acceleration is the sum of all a_{i }, denoted as S.
It is not difficult to find that the total speed increment S is also a random variable.
In order to test whether the acceleration effect is "steady", Xiao Hua would like to know, given the features of distribution which n and ai obey (given the expectations and variance), how much is the variance of random variable S ?
 Input
The first line of the input file is a positive integer T（1<=T<=20），indicating that there are T test cases.
As for each test case：there is only one line contains four integers representing μ_{n}，σ_{n}^{2}，μ_{a}，σ_{a}^{2}.
0<μ_{a}<=100, 0<=μ_{n},σ_{n},σ_{a}<=100.
 Output
For each set of samples, output the variance of the random variable S.
 sample input

4 2 0 10 4 2 3 6 4 5 2 5 3 3 4 3 0
 sample output

8 116 65 36
 hint
Standard input and output.
n~N(μ,σ^{2})means random variable nobeys normal distribution. The expectation is μ, the variance is σ^{2}，it is obvious that the variance isnonnegative.
 source
 sunzhenyu