← Back to Problems
Singular Integral
Easy standard Numerical Methods
Time limit: 2 s per test  ·  Memory: 256 MB

For real parameters a and b, define

I(a, b) = integral from 0 to 1 of exp(a x) / ((1 + b x^2) sqrt(x)) dx.

You are given q queries. For each query, compute I(a, b) to the requested accuracy.

Input

The first line contains the integer q. Each of the next q lines contains a, b, and a tolerance tol, with a and b having at most 6 digits after the decimal point.

Output

q lines. Line i must contain your value of I(a_i, b_i), and must differ from the true value by at most tol_i in absolute value.

Constraints

1 <= q <= 1000

-3 <= a <= 3

0 <= b <= 5

1e-12 <= tol <= 1e-3

Scoring

This is a standard problem: a submission scores full points if it produces the correct output for every test case, and zero otherwise.

Examples

input
3
0.0 0.0 1e-09
1.0 1.0 1e-09
-2.5 3.0 1e-06
output
2.0 1e-09
2.390938628631036 1e-09
0.9677084035968612 1e-06
input
1
2.0 0.5 1e-12
output
4.041135085830283 1e-12
Python 3.13 i Execution environment Isolated microVM · 1 vCPU · no internet access Time and memory limits are set per problem Available packages numpy 2.5.0scipy 1.18.0pandas 3.0.0scikit-learn 1.9.0statsmodels 0.15.0cvxpy 1.9.2