Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Programming dare

Name: Geomaster 2013-04-11 16:39

Here's an interesting problem /prog/

Projections Of A Polygon
Problem code: KPPOLY

You are given a convex polygon on Cartesian coordinate system. It has projections on X and Y-axis. You can arbitrary rotate this polygon. What minimum and maximum sum of projections can you achieve?
-Input:
First line contains one integer number N (3 ≤ N ≤ 100) - number of polygon's vertices. Following N lines contain vertex coordinates Xi and Yi. All numbers are integers. Vertices are given in clockwise or anticlockwise direction. No two vertices coincide. No three consecutive vertices lie on the same line. All coordinates do not exceed 10000 by absolute value.
-Output:
Write minimum and maximum value of sum of the polygon's projections. Separate them by a space. Your answer should not differ with the correct one more than 10-6.

Example:
-Input:
4
0 0
0 1
1 1
1 0
-Output:
2 2.828427124

Name: Anonymous 2013-04-11 18:18

>>1
Maybe you should boost your SPOJ score by yourself.

Name: Anonymous 2013-04-11 18:20

sum of projections
wut?

Name: Anonymous 2013-04-11 18:34

>>1
I dare you to do your own homework.

Name: Anonymous 2013-04-11 18:56

>>3
The projection on the X and Y axes summed up.

Name: Anonymous 2013-04-11 23:18

consider it added to my fibonacci butt heat of fun things to do.

Name: Anonymous 2013-04-11 23:57

oh god

corrected: fibonacci butt heap

Don't change these.
Name: Email:
Entire Thread Thread List