From today I plan that I do not post the code of problem of Light Online Judge direcly . But guys still I am here to help you .
This problem can be solved by trigonometric ratio . See the image .
In first image the big circle contains 6 small circles . So the angle is (PI/6) . When the bigger circle contains n small circles then the angle be (PI/n) .
Now from the knowledge of trigonometric ratio , we can write
sin(PI/n) = r/(r-R)
so r=sin(PI/n)*R/sin(PI/n)
Do not forget to initialize Pi with arc-cos(-1) . Have a great day .
This problem can be solved by trigonometric ratio . See the image .
In first image the big circle contains 6 small circles . So the angle is (PI/6) . When the bigger circle contains n small circles then the angle be (PI/n) .
Now from the knowledge of trigonometric ratio , we can write
sin(PI/n) = r/(r-R)
so r=sin(PI/n)*R/sin(PI/n)
Do not forget to initialize Pi with arc-cos(-1) . Have a great day .
