Tuesday, August 19, 2025

Lightoj 1072 solution in English

Problem Link: Lightoj 1072




In this problem, we are given:

  • The radius of a large outer circle
    RR

  • The number of smaller circles
    nn
     that fit inside the larger circle, touching it

We need to find the radius of each smaller circle 
r


Step 1: Angle subdivision

We know a full circle is 
360360^\circ
.
If there are 
nn
small circles inside, they divide the large circle into 
nn
equal sectors.

So, the angle at the center of the large circle subtended by one small circle is:

360n=180n=πn\frac{360^\circ}{n} = \frac{180^\circ}{n} = \frac{\pi}{n}



Step 2: Using trigonometry

Consider the triangle formed by:

  • The center of the large circle

  • The center of one small circle

  • The point of tangency on the large circle

In this triangle:

  • The opposite side = 
    rr
    (radius of the small circle)

  • The hypotenuse = 
    RrR - r

So:

sinθ=rRr,θ=πn\sin\theta = \frac{r}{R - r}, \quad \theta = \frac{\pi}{n}



                                   

Step 3: Solve for 
rr

sin(πn)=rRr\sin\left(\frac{\pi}{n}\right) = \frac{r}{R - r} r=sin(πn)(Rr)r = \sin\left(\frac{\pi}{n}\right)(R - r) r=Rsin(πn)rsin(πn)r = R\sin\left(\frac{\pi}{n}\right) - r\sin\left(\frac{\pi}{n}\right) r+rsin(πn)=Rsin(πn)r + r\sin\left(\frac{\pi}{n}\right) = R\sin\left(\frac{\pi}{n}\right) r(1+sin(πn))=Rsin(πn)r(1 + \sin(\tfrac{\pi}{n})) = R\sin\left(\tfrac{\pi}{n}\right) r=Rsin(π/n)1+sin(π/n)\boxed{r = \frac{R \sin(\pi/n)}{1 + \sin(\pi/n)}}

Thus, the radius of each inner small circle is:

r=Rsin(π/n)1+sin(π/n)r = \frac{R \sin(\pi/n)}{1 + \sin(\pi/n)}

Would you like me to also provide a short Python function that computes 
rr
for given 
RR
and 
nn
?


Source Code:

Another problem like this, 

Problem Link :  codeforces 1100 C

Source Code : SourceCodeLink




Share:

0 comments: