Loading environment...
Ron wants to build a square pool in his square -by- yard, but his yard contains trees. Your job is to determine the side length of the largest square pool he can build.
The first line of input will be an integer with . The second line will be the positive integer where . The remaining input will be lines, each representing the location of a single tree. The location is given by two positive integers, and then , separated by a single space. Each tree is located at row and column where rows are numbered from top to bottom from to and columns are numbered from left to right from to . No two trees are at the same location.
The following table shows how the available 15 marks are distributed.
| Marks Awarded | Length/Width of Yard | Number of Trees |
|---|---|---|
| 3 marks | ||
| 5 marks | ||
| 4 marks | ||
| 3 marks |
Output one line containing which is the largest positive integer such that some -by- square contained entirely in Ron's yard does not contain any of the trees.
A picture of the yard is below. The location of the tree is marked and one of several 3-by-3 squares that do not contain the tree is highlighted. All larger squares contain a tree.
A picture of the yard is below. The location of each tree is marked and one of several 7-by-7 squares that do not contain a tree is highlighted. All larger squares contain a tree.
No comments yet. Be the first to comment!