#P4023. [CTSC2012] 极点统计
[CTSC2012] 极点统计
Description
For a set of points in the plane and a point in the plane, define the function to be if and only if lies inside the convex hull of (including its boundary), and otherwise.
Given two sets of points in the plane and , we call a point an extreme point if and only if
That is, is not inside the convex hull formed by together with any other single point from .
Please count the number of extreme points in set .
Input Format
- The first line contains two space-separated positive integers and .
- The second line contains space-separated pairs of integers; the -th pair denotes the coordinates of point .
- The third line contains space-separated pairs of integers; the -th pair denotes the coordinates of point .
- For the same set, the input guarantees that no two points share identical coordinates.
Output Format
Output a single line with a single integer, the number of extreme points in set .
4 5
6 3 7 -1 -6 -5 1 5
-5 -5 7 -5 9 -9 -10 11 -5 -6
3
Hint
Constraints:
- For of the testdata, .
- For another of the testdata, .
- For of the testdata, $3\le N\le 10^5, 1\le M\le 10^5,\ |x_i|,|y_i|\le 10^6$, and the convex hull of set has non-zero area.
Translated by ChatGPT 5
京公网安备 11011102002149号