Yeehaa!
Time limit1sMemory limit128 MB
Given the large circle radius R and the count n of equal small circles packed around the inside rim, compute the small circle radius r.
- Level
Easy3 of 10
- Topics
- Geometry, Math, Implementation
- Solved
- No attempts yet
Problem
George wants to become a western hero, so he dreams of a special revolver that can fire more than the usual six shots. The cylinder that holds the bullets looks like the figure below (examples for 6 and 17 bullets):

Figure 1: Examples
There is one large circle of radius , and small circles of radius placed inside it along its border. To make the bullets as large as possible, the small circles are packed with no gaps: each small circle is tangent to the large circle and also to its two neighboring small circles. Given and , compute .
Input
The first line contains the number of scenarios. Each of the following lines describes one scenario and contains a real number and an integer , with and .
Output
For each scenario, first print a line Scenario #i:, where is the scenario number starting at 1. On the next line, print the value of rounded to three decimal places. Separate consecutive scenarios with a blank line.