Problem Statement |
| You have a rectangle with corners at (0, 0) and (m, n). You would like to place a convex polygon inside it such that the polygon's vertices are at integer coordinates. The vertices may lie anywhere inside the rectangle or on its boundary.
You are given m and n, the dimensions of the rectangle. Return the maximal number of vertices contained by the convex polygon. |
|
Definition |
| Class: | ConvexHull | Method: | intHull | Parameters: | int, int | Returns: | int | Method signature: | int intHull(int m, int n) | (be sure your method is public) |
|
|
|
|
Constraints |
- | m and n will be between 3 and 200, inclusive. |
|
Examples |
0) | |
| |
1) | |
| |
2) | |
| |
3) | |
| |
4) | |
| |