We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

- All Contests
- ProjectEuler+
- Project Euler #235: An Arithmetic Geometric sequence

# Project Euler #235: An Arithmetic Geometric sequence

# Project Euler #235: An Arithmetic Geometric sequence

_{This problem is a programming version of Problem 235 from projecteuler.net}

Given is the arithmetic-geometric sequence .

Let .

Find the value of for which .

Give your answer rounded to places behind the decimal point.

**Input Format**

First line of each test file contains a single integer which is the number of queries per test file. lines follow, each containing exactly four integers separated by single spaces which are , , and .

**Constraints**

**Output Format**

Print exactly numbers on the separate lines that are the 's for the corresponding tests. Your answers will be considered as correct if they coincide with the author's ones in digits after the decimal point.

**Sample Input 0**

```
1
1 1 3000 100000000
```

**Sample Output 0**

```
1.00136521495144
```