Page 2 of 2
Posted: Mon Jun 07, 2004 6:20 pm
The value I calculated is the same as cooleye's but I got WA. But Scott's value could get AC. Could someone explain it?

### Wrong picture of five triangles

Posted: Sun Jul 11, 2004 8:36 pm
Hi to all.
It is my first writing in this E-Board.

The picture for the 5 triangles, given with the problem by judge is wrong. at first I calculated assuming that the position of upper left triangle correct (assuming that it is inclined with the upper side of square). But not. The position of the lower left triangle is correct. And if you assume this and calculate this you will get AC.

But you can rotate these two triangles and in that case there might be some gap with other triangles. So the answer is not correct. Hope I could convince all to you.

So for the fifth picture side = s*(2 + sqrt(3)) / (5 + sqrt(3)).

I think the judge should change the picture so that others do not fell in this problem. The main object of a problem is to taste ones knowledge not to deceive him. ### 10289

Posted: Mon May 02, 2005 6:57 am
Can Any Body Help Me With Some I/o For The Problem 10289
I Think I Got Some Problem With Precission

Rocky

Posted: Wed May 04, 2005 12:58 am
Hi Rocky.

Try this

Input

Code: Select all

``````10000.000
10000
0.0000001
0.1000212
0.0000000
0
7651.6712
982.8723
34.534
853.943223
8543.123
76345.7542
757.352
4523.6
523.423
``````
Output

Code: Select all

``````10352.7618041008 8164.9658092773 6764.0791490305 6339.7459621556 5543.7056466848 5257.8342306321 4766.2710943897
10352.7618041008 8164.9658092773 6764.0791490305 6339.7459621556 5543.7056466848 5257.8342306321 4766.2710943897
0.0000001035 0.0000000816 0.0000000676 0.0000000634 0.0000000554 0.0000000526 0.0000000477
0.1035495659 0.0816669678 0.0676551313 0.0634108999 0.0554488091 0.0525894889 0.0476728154
0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000
0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000
7921.5929336898 6247.5633731831 5175.6509619157 4850.9651593942 4241.8612838016 4023.1218756902 3646.9939264334
1017.5442805749 802.5118724386 664.8226030590 623.1160695240 544.8754719480 516.7779623280 468.4635832966
35.7522276143 28.1968929258 23.3590709333 21.8936787057 19.1446330803 18.1574047321 16.4598405974
884.0670781945 697.2417218859 577.6139549150 541.3783099924 473.4009867293 448.9891908906 407.0124900035
8844.4917482135 6975.4307199450 5778.6360151903 5416.1229543449 4736.0559215423 4491.8324545900 4071.8840210716
79038.9407987030 62336.0472726486 51640.8724101229 48401.2686917175 42323.8388658952 40141.3319796183 36388.4561422842
784.0684857859 618.3753185588 512.2788871677 480.1419283930 419.8536558928 398.2031270238 360.9744945878
4683.1753297031 3693.5039334847 3059.7988438554 2867.8474834407 2507.7506863344 2378.4338925687 2156.0703922581
541.8873641788 427.3730898789 354.0474600423 331.8368850749 290.1703040705 275.2071366500 249.4775915039
``````
Hope it helps ### 10289 rejudge

Posted: Sun Jan 21, 2007 1:26 pm
Hello!

I have problem with 10289. This problem was rejudged. Before rejudge, I solved this problem successful with first submit. But after rejudge I have WA. I tried add to t1..t7 small value (1e-12; 1e-15), but still WA... Please: can someone explain, where may be a problem? I coded it in Pascal - should I code it in C/C++? Or something else...?

Thanks!

Posted: Sun Jan 21, 2007 3:05 pm
The case with 5 triangles was not optimal, so you must re-examine your calculations for this case if you previously got accepted. Hint: the topmost right triangle is slightly left of the bottommost right triangle. I couldn't find a direct analytical method so I used an iterative numerical method.

### Re: 10289 - A Square & Equilateral Triangles

Posted: Thu Jul 31, 2014 2:08 am
all the tests I did, worked well.
But I am getting wrong answer, anyone know where I am going wrong? Code: Select all

``````        a = n/(sin((75*pi)/180));
b=n/sin((120*pi)/180)*sin((45*pi)/180);
c=n*sqrt(2)/sqrt(3)*2/(1+sqrt(2));
d=n*sqrt(3)/(1+sqrt(3));
e=n*(2 + sqrt(3)) / (5 + sqrt(3));
f=n*(sqrt(3)+3)/9;
g=n*(sqrt(3)+1)/(4+sqrt(3));

printf("%.10Lf %.10Lf %.10Lf %.10Lf %.10Lf %.10Lf %.10Lf\n",a,b,c,d,e,f,g);
``````
i am using pi as

Code: Select all

``````# define pi          3.141592653589793238462643383279502884L
``````

### Re: 10289 - A Square & Equilateral Triangles

Posted: Thu Jul 31, 2014 10:19 pm
Post your full code. I solved it using double and M_PI. Your formula for t5 is wrong. See the post before yours.

### Re: 10289 - A Square & Equilateral Triangles

Posted: Fri Aug 01, 2014 2:45 pm
Hi guys... i have to solve this problem for our training to a contest in Brazil... i got that formula for t5 ( sqrt(3) + 2 / sqrt(3) + 5) but after i saw previous messages , people said it's wrong. Can somebody explain me why please? I couldn't understand that ideas before about the 5 case not optimal... thanks.

### Re: 10289 - A Square & Equilateral Triangles

Posted: Fri Aug 01, 2014 10:08 pm
(2.0 + sqrt(3)) / (5.0 + sqrt(3)) = 0.554, the correct answer is 0.555

### Re: 10289 - A Square & Equilateral Triangles

Posted: Fri Aug 01, 2014 10:53 pm
but is it necessary to use some numerical method to get this 0.555? All the geometry i did arrive in 0.554, is the picture for case 5 wrong? Are the heights of the uppermost and bottommost triangle same axis?

### Re: 10289 - A Square & Equilateral Triangles

Posted: Thu Aug 07, 2014 1:11 am Point A is on the right edge of the square, at the same height as the top of the bottom center triangle.
Point B is the bottom right of the right triangle.
Point C is the left of the right triangle.
Point D is the top of the right triangle.
Point E is the bottom of the top center triangle.
Point F is the left of the left triangles.
Point G is the top of the bottom center triangle.

I am measuring (x = horizontal distance from the left of the square, y = vertical distance from the bottom of the square)
I solved for t5 using a binary search. First I set S equal to 1.0
Point G is at (t5, sqrt(3.0) * t5 / 2.0)
Point E is 0.0014 to the left of point G.
Point A is at (1.0, sqrt(3.0) * t5 / 2.0)
Point F is at (0.0, sqrt(3.0) * t5 / 2.0)
First solve for dAG = distance from A to G, then dAB. You can now find the coordinates of B, C, and D.
Using the circle equation, line equation, and quadratic formula, find the point E which is distance t5 from F along the line from C to D.
If Ey plus the height of the triangle is greater than 1.0, then lower the upper limit, otherwise raise the lower limit.

### Re: 10289 - A Square & Equilateral Triangles

Posted: Fri Aug 15, 2014 4:33 pm
Thank you brianfry. I will try this problem again using numerical ideas, this drawing helped me to understand the figure, the upper triangle is not aligned to the bottom, and this turned the problem to be very hard hehehehe. 