11243 - Texas Trip

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

Moderator: Board moderators

sith
Learning poster
Posts: 72
Joined: Sat May 19, 2012 7:46 pm

Re: 11243 - Texas Trip

Post by sith » Tue Sep 11, 2012 10:10 am

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

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11243 - Texas Trip

Post by brianfry713 » Tue Sep 11, 2012 8:32 pm

2*2=4
Check input and AC output for thousands of problems on uDebug!

sith
Learning poster
Posts: 72
Joined: Sat May 19, 2012 7:46 pm

Re: 11243 - Texas Trip

Post by sith » Wed Sep 12, 2012 10:13 am

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?

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11243 - Texas Trip

Post by brianfry713 » Wed Sep 12, 2012 8:20 pm

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).
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 112 (11200-11299)”