- All Contests
- ProjectEuler+
- Project Euler #199: Iterative Circle Packing

# Project Euler #199: Iterative Circle Packing

# Project Euler #199: Iterative Circle Packing

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

circles of equal radius are placed inside a larger circle such that each consecutive pair of inner circles is tangent to one another, all the inner circles are tangent to the larger one and do not overlap. There are uncovered "gaps" which are to be filled iteratively with more tangent circles.

Picture for

At each iteration, a maximally sized circle is placed in each gap, which creates more gaps for the next iteration. After iterations (pictured), there are gaps and the fraction of the area which is not covered by circles is , rounded to eight decimal places.

What fraction of the area is not covered by circles after iterations?

**Input Format**

Each test file contains exactly two integers separated by a single space: and .

**Constraints**

**Output Format**

Output exactly one number that is the area not covered by circles after all iterations. Your answer will be considered as correct if the absolute difference between it and the author's one does not exceed .

**Sample Input 0**

```
3 3
```

**Sample Output 0**

```
0.067903417174
```

**Sample Input 1**

```
4 1
```

**Sample Output 1**

```
0.166522241370
```

**Explanation 1**

The initial circles use of the big circle's space. The green circles added at the first iteration use of the space.