#C5938. Minimum Value of a Trigonometric Expression
Minimum Value of a Trigonometric Expression
Minimum Value of a Trigonometric Expression
In this problem, you are given T test cases. For each test case, you are provided with two real numbers a and b. Your task is to compute the minimum value of the trigonometric expression $$g(x)=a\cos x+b\sin x$$ where (x) ranges over ([-\pi, \pi]). It is known that the minimum value of this expression is (-\sqrt{a^2+b^2}). You must format the output to six decimal places for each test case.
inputFormat
The first line contains an integer T, representing the number of test cases. This is followed by T lines, each containing two space-separated real numbers a and b.
outputFormat
For each test case, output a single line containing the minimum value of the expression, formatted to exactly six decimal places.## sample
1
3 4
-5.000000
</p>