Points
Time limit1sMemory limit128 MB
Count triangles formed by white points that have no black point strictly inside them.
- Level
Medium7 of 10
- Topics
- Geometry, Combinatorics, Sorting, Two pointers
- Solved
- No attempts yet
Problem
There are points on the plane. Exactly of them are white and the remaining are black.
Count the number of triangles whose three vertices are white points and that contain no black point in their interior.
You may assume that no three points are collinear.
Input
The first line contains two integers and (), the number of white points and the number of black points, respectively.
The next lines describe the white points, and the following lines describe the black points. Each line contains two integers and (), the coordinates of a point.
Output
Print, on a single line, the number of triangles with white vertices that contain no black point inside.
Hint

The figure above illustrates the first example.