Enjoy an ad free experience by logging in. Not a member yet? Register.

Results 1 to 2 of 2
Thread: I can't think any more

07262009, 11:08 PM #1
 Join Date
 Jul 2009
 Posts
 6
 Thanks
 0
 Thanked 0 Times in 0 Posts
I can't think any more
Can somebody please help me, i found this task on net and i really don't know how to do it. Please HELP!!!!!!
There are N nails on the Z's wooden door. You have to but two rubber bands around the nails, so that all the nails are inside one of the two rubber bands, and the total area inside the two rubber bands is minimized.
INPUT:
From the first line of the standard input read one integer N, 2 <= N <= 1000. From each of the next N lines read two integers x and y representing the x and y coordinate of the corresponding nail. All the coordinates will be between 0 and 1000000.
OUTPUT:
To the standard output write one real number with two decimal point precision, representing the minimal possible area of the two rubber bands such that they cover all the nails.
Input:
6
0 0
0 2
1 1
100 0
100 2
101 1
Output:
2.00
Input:
4
0 0
1 1
100 100
200 200
Output:
0.00
In this case we cover the nails (0,0) and (1,1) with the first rubber band, and (100,100) and (200,200) with the second. Both areas are 0 (since they are lines)Last edited by Ste94; 07262009 at 11:10 PM.
07262009, 11:59 PM
#2
 Join Date
 Jul 2009
 Posts
 52
 Thanks
 10
 Thanked 4 Times in 4 Posts
Ask for a refund. It's a badly written question.
Maybe the questioner/torturer wants you to write a simple program to do some kind of basic iterative task, comparing some basic patterns and coming up with a winner or loser.
i.e.
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
the top one has an area of 0 + 16
the bottom one has an area of 12 + 8
Or so it vaguely seems from trying to comprehend the question. Was it composed by a torturer in Guantanamo Bay, Cuba? It certainly seems to be made by someone with sadistic tendencies. Choose life. If it's homework, put it in the shredder. Obedience is the fuel of fascism.
Last edited by RabidMango; 07272009 at 12:04 AM.