## 11243 - Texas Trip

Moderator: Board moderators

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

### Re: 11243 - Texas Trip

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

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

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

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!