10345  Cricket/Football Goes Down
Moderator: Board moderators
10345  Cricket/Football Goes Down
How can i determine r3 in fig3
Radius of the circle surrounding triangle is the hint. Pick any three points that touch the circle and form a triangle. Other thing is math.
But I want to ask how to calculate r6. I seem to be having trouble. I've tried it many ways, but I still get wrong answer for r6... even for sample output.
Ivor
But I want to ask how to calculate r6. I seem to be having trouble. I've tried it many ways, but I still get wrong answer for r6... even for sample output.
Ivor
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

 Experienced poster
 Posts: 167
 Joined: Fri Oct 19, 2001 2:00 am
 Location: Saint Petersburg, Russia
May be I've did it in some perverted way but I got AC and it's enough for me
So, for case N == 6 here is the picture:
We have three points with coordinates:
1: 2*sz, sz
2: sz+d, sz
3: zsqrt(2)*s+d, zs/sqrt(2)+d
There is a linear dependency of Radius from Side length, so we can construct and solve system of three equation.
Although I've got a terrible final equation it works!
(I suspect that there's an easier way but my math isn't perfect, unfortunately...)
So, for case N == 6 here is the picture:
We have three points with coordinates:
1: 2*sz, sz
2: sz+d, sz
3: zsqrt(2)*s+d, zs/sqrt(2)+d
There is a linear dependency of Radius from Side length, so we can construct and solve system of three equation.
Although I've got a terrible final equation it works!
(I suspect that there's an easier way but my math isn't perfect, unfortunately...)

 Guru
 Posts: 834
 Joined: Wed May 29, 2002 4:11 pm
 Location: Wroclaw, Poland
 Contact:
I'm having trouble on calculating r6, even after reading previous post......
So could anone plz help me??!!!!
I intended to solve it by considering some angles, but in vain......
So could anone plz help me??!!!!
I intended to solve it by considering some angles, but in vain......
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
........... No reply???? ..........
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Thx!!
Finally I got an ACC using bisection with Ivan's equations.
Thanks again and again!!!!!
Finally I got an ACC using bisection with Ivan's equations.
Thanks again and again!!!!!
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00  16:00 (UTC)
URL: http://uva.onlinejudge.org

 Guru
 Posts: 5947
 Joined: Thu Sep 01, 2011 9:09 am
 Location: San Jose, CA, USA
Re:
No, that is wrong, they do NOT touch, look closely at the figure and you'll see a gap.htl wrote:I think that the equations of Ivan are based on the assumption that the upperright side of the lowerleft square of fig.6 touches the lowerleft vertex of the square in the center.
Here is a rough image of where d and z and the 3 points are.
I used Ivan's 3 points and a binary search to get an accurate enough value for the ratio of a square side to the radius. s is the side of a square, you can set it to 1 for the binary search on the radius. If you have a point x,y on the circumference of a circle you know x*x+y*y=r*r. From point 1 you can solve for z, from point 2 you can solve for d, and point 3 decides which direction to continue the binary search.
Check input and AC output for thousands of problems on uDebug!