#P17190. [ICPC 2017 Hong Kong R] Triangle
[ICPC 2017 Hong Kong R] Triangle
Problem Description
Bob draws black points and white points in the plane, and draws directed edges between each pair of them. For each pair of points and , Bob can draw an edge according to the following rules.
- If these two points share the same color, put an edge or optionally.
- If they have different colors, suppose that is white and is black, then draw the edge if , or if not.
The distance function is defined as .
Bob thinks that a beautiful triangle of points , and (which is a triple of three points) should satisfy the following conditions:
- At least one of them is black, and at least one of them is white.
- , , and are all the edges between them.
Now Bob wants to know the minimum number and the maximum number of beautiful triangles could exist.
Input Format
The input contains several test cases, please handle it to the end of file.
For each test case, the first line contains two integers () and . In the next lines, each line contains two integers indicating the coordinate of a white point. In the next lines, each line contains two integers indicating the coordinate of a black point. Some points may share the same coordinate.
All numbers in input are non-negative integers and less than .
Output Format
For each test case, output two integers indicating the minimum number and the maximum number of beautiful triangles.
2 1
1 2
1 1
3 1
2 2
0 2