SRM 607, D2, 250-Pointer (BoundingBox)

James S. Plank

Mon Sep 30 11:51:42 EDT 2019

In case Topcoder's servers are down

Please use the workflow in the problem Cryptography. You can test yourself with tests.sh, and your output should match answers.txt. The problems in tests.sh go up to 1000 points in size -- your program should solve these in the blink of an eye.

Here is a summary of the problem:


Examples

Example X Y Answer
0 {0,1} {1,0} 1
1 {0,-2,-1} {-1,-1,-2} 2
2 {0,0,1,0,-1,2} {0,1,2,-2,0,-1} 12
3 {9,-88,-40,98,-55,41,-38} {-65,56,-67,7,-58,33,68} 25110


Try this one on your own first. I suggest graphing examples 1 and 2, and the answer should fall out pretty naturally.








































The bounding box will be defined by the:

The width of the bounding box is maxx-minx, and the height is maxy-miny.