10286 - Trouble with Pentagon

All about problems in Volume CII. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

10286 - Trouble with Pentagon

Postby Almost Human » Mon Jun 09, 2003 4:50 am

What are we looking for actually ???

can I use the height of the pentagon to define the side length ???

code :
Code: Select all
#include <math.h>
#include <stdio.h>

int main ( void )
{
   long double s , output , pi = 3.1415926535897932384626433832795 ;

/*   freopen ( "10286.in" , "r" , stdin ) ;
   freopen ( "10286.out" , "w" , stdout ) ;*/

   while ( scanf ( "%Lf" , &s ) != EOF )
   {
      output = ( s * sin ( 36 * pi / 180 ) + s * cos ( 18 * pi / 180 ) ) / sqrt ( 2 ) ;

      printf ( "%.10Lf\n" , output ) ;
   }

   return 0 ;
}
Almost Human
Learning poster
 
Posts: 93
Joined: Sun Jan 12, 2003 3:30 pm

Postby hujialie » Sun Jun 29, 2003 3:55 pm

To Almost Human:

You should notice that the low point of the square is a bit higher than the
horizontal line,so you can't calculate the diagonal of the square by the height of pentagon and,of course ,the side of square.

Try to solve it from another angle----using sine theorem(I am not sure whether it should say so),i.e.,the theorem pointing out the relationship between the edge and angle of a triangle.

If you want some test data,mailto me.
Good luck. :)
Retired from SJTU Accelerator 2004
hujialie
New poster
 
Posts: 43
Joined: Thu Apr 17, 2003 10:24 am
Location: Shanghai,China

Postby anupam » Sun Jun 13, 2004 8:40 am

Would you please leave a bit more discussion to solve the problem?
Anupam
"Everything should be made simple, but not always simpler"
anupam
A great helper
 
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm

Postby Raiyan Kamal » Sun Jun 13, 2004 3:58 pm

This problem can be solved without taking the height in concideration. Think about the triangle that is formed when the prntagon is touching the two adjacent sides of the sqr.

Dear Anupam bhai, sine rule ( as we were taught in school ) can be used to solve this
Raiyan Kamal
Experienced poster
 
Posts: 106
Joined: Thu Jan 29, 2004 12:07 pm
Location: Bangladesh

Postby anupam » Mon Jun 14, 2004 8:00 am

Ha ha,
this is the ever smallest program from me (just 2 lines).
Thanks Raiyan Kamal. Sometimes, very easy problem seems tough to me.
Thanks again.
"Everything should be made simple, but not always simpler"
anupam
A great helper
 
Posts: 405
Joined: Wed Aug 28, 2002 6:45 pm

Re: 10286 - Trouble with Pentagon

Postby stcheung » Fri Oct 24, 2008 8:27 am

Isn't the answer of the form F * sin(a) / sin (b)?

I calculated values for a & b, but the result is different from output. I then used brute-force to come up with values for (a, b) that would yield sample output, but these all got me WA. Any idea? Can somone provide more output? Thanks.
stcheung
Experienced poster
 
Posts: 114
Joined: Mon Nov 18, 2002 6:48 am

Re: 10286 - Trouble with Pentagon

Postby sefakilic » Fri May 08, 2009 8:00 am

Hello,

I am getting Presentation Error.
What can be the reason?

Code: Select all
REMOVED


Thanks.

edit: It seems ACCEPTED now. :s

-- sefa kilic
sefakilic
New poster
 
Posts: 7
Joined: Wed Mar 11, 2009 8:12 pm

Re: 10286 - Trouble with Pentagon

Postby Asma_ju » Sat Jun 11, 2011 11:39 am

Code: Select all
sside=pside/sin(108*PI/180);
        cout<<setprecision(10)<<fixed<<sside<<endl;

Is this logic correct?
If wrong may anyone can give some idea or test case?
Asma_ju
New poster
 
Posts: 4
Joined: Sat Jun 11, 2011 9:20 am


Return to Volume CII

Who is online

Users browsing this forum: No registered users and 1 guest