Under construction

Still being built. Things may change

Arthur's Table

Time limit1sMemory limit512 MB

Summary
Given a round table's diameter, the number of knights, and the offset of the central platter, find the platter's radius and the first four trenchers' centers and radii.
Level

Hard8 of 10

Topics
Geometry, Binary search, Math, Implementation
Solved
No attempts yet

Problem

King Arthur is known for believing that all knights are equal, and for his round table.

At the center is a serving platter (did Merlin invent the lazy Susan?).

Each knight has a circular trencher to eat from:

Unfortunately, Merlin accidentally called up a pre-shadow of George Orwell, and Arthur began muttering something like:

... but some knights are more equal than others ...

So Arthur asked Merlin to move the central serving platter a little away from him, so that he and his closest aides could have a little more room:

Merlin complained that every trencher and the central serving platter would have to be remade. Arthur, like a good leader, said, 'Deal with it.'

Write a program to help Merlin make the new trenchers and central serving platter. We describe the layout in a coordinate system with its origin at the center of the table, the xx axis pointing to Arthur's seat, and the yy axis perpendicular to the xx axis:

Input

Input consists of a single line containing the diameter DD of the table in kingly feet (8 \le D \le 30), the number NN of knights to be seated (7 \le N \le 40), and the offset OO from the center of the table to the center of the central serving platter (0.1 \le O <$ the radius of an original trencher), given as a decimal number of kingly feet.

Output

The output consists of five lines. The first line gives the radius of the central serving platter in kingly feet, to 3 decimal places, with center at (−O,0)(-O, 0). Here the offset is the input OO.

The next four lines each contain three space-separated floating-point values to 3 decimal places. These values are the xx coordinate of a trencher's center, the yy coordinate of the trencher's center, and the trencher's radius, all in kingly feet. The four lines give Arthur's trencher and the next three trenchers counter-clockwise from Arthur's, one set of values per line.

Examples1

  1. Example 1

    Input
    10 11 0.5
    
    Expected output
    2.761
    3.631 0.000 1.369
    2.703 2.513 1.310
    0.572 3.785 1.172
    -1.625 3.621 1.031