Page 3 of 3

Re: 10573 - Geometry Paradox

Posted: Tue Aug 26, 2008 10:10 pm
by newton

Code: Select all

Accepted!
Actually if there is one input then it is the diameter of the outer circle which contains the two similar circle.
Really confusing!



And there is no floating point input in judges file.
Thank you.

Re: 10573 - Geometry Paradox

Posted: Fri Feb 06, 2009 10:13 am
by vahid sanei
these kind of problems just waste our time
why "t" is diameter ???
in image in the problem "t" is`nt diameter :D
so i have some other test cases
in the problem problem setter says "All these integers are less than 100" so
can you solve these test cases? :

Code: Select all

-1 -2
-100
0 -100

Re: 10573 - Geometry Paradox

Posted: Sun Sep 04, 2011 6:09 pm
by willmetalufg
I saw many people discussing about the case where only t is given.
Many of you supposed the radius of the two inner circles are equals in this case.
But in fact, the resulting area is invariant with the radius in this case.

To prove this is used the following idea.

Make a big circle of radius R.
The tangent of length t will divide the circle in two sides (not necessarily equals).
If we trace the perpendicular line to the tangent passing through the center of the circle we will
divide the tangent in the middle.

Tracing a line from the center of the circle to one of the intersecting points between the tangent and the circle perimeter
we make a triangle.
Two of the sides will be R and t/2 and the third we call x.
Thus, r1 = (R + x)/2 and r2 = (R - x)/2. (1)

If we suppose a angle theta will be formed between the sides of length R and x, using the trigonometric identities we have:
R = (t/2) / sin(theta) and x = (t/2) * cos(theta) / sin(theta) (2)

We also know from the problem description that the area we search is

A = pi * R^2 - ( pi * r1^2 + pi * r2^2)

From (1),
= pi * R^2 - pi/4 * ( (R + x)^2 + (R - x)^2)
= pi * R^2 - pi/4 * ( 2 * R^2 + 2 * x^2 )
= pi * 1/2 * (R^2 - x^2)

From (2),
= pi * 1/2 * (t^2/4) * ( 1/sin^2(theta) - cos^2(theta)/sin^2(theta) )
= pi * t^2/8 * ( 1 - cos^2(theta ) ) / sin^2(theta)
= pi * t^2/8 (3)

Then the area we search is pi * t^2/8

A little observation from the equation (2): if sin(theta) is 0, then the result would be undetermined.
But sin(theta) is 0 only if t = 0 and in this case r1 = R and r2 = 0. Thus, the resulting area is 0, that is right according to (3).

Thus, the area is independent from r1 and r2 when we have only t.

I hope I made it clear.

Good coding for all. =)

Re: 10573 - Geometry Paradox

Posted: Sun Jul 15, 2012 12:13 am
by PromeNabid
vahid sanei wrote:these kind of problems just waste our time
why "t" is diameter ???
in image in the problem "t" is`nt diameter :D
so i have some other test cases
in the problem problem setter says "All these integers are less than 100" so
can you solve these test cases? :

Code: Select all

-1 -2
-100
0 -100
* A circle's radius can not be defined negative.
* If radius is 0 then it is a dot.
* Chord of a circle can not be negative or dot.
So I must say, "All these integers are less than 100" is good because the setter declared those as Circles.
Thank you.