Page 2 of 2

Re: 11243 - Texas Trip

Posted: Tue Sep 11, 2012 10:10 am
by sith
But if we have to cover points by square, how can the first sample has answer 4 ?


4
-1 -1
1 -1
1 1
-1 1

Re: 11243 - Texas Trip

Posted: Tue Sep 11, 2012 8:32 pm
by brianfry713
2*2=4

Re: 11243 - Texas Trip

Posted: Wed Sep 12, 2012 10:13 am
by sith
Ok.


Lets back again to the this case

4
10 1
10 -1
-10 1
-10 -1

It is coordinates of rectangle

So the longest line length is 20 - so the minmum square will be 400, why correct result is 242?

Re: 11243 - Texas Trip

Posted: Wed Sep 12, 2012 8:20 pm
by brianfry713
Draw it out. The square you're thinking of with corners at (-10,-10),(-10,10),(10,10),(10,-10) will cover the 4 points with area 400. The square with minimum area 242 covering the 4 points has corners at (-11,0),(0,11),(11,0),(0,-11).