Cow curling involves two teams, each moving N heavy rocks (3 <= N <= 50,000) across the ice. At the end of the game, there are 2N stones on the ice, each located at a different point
plane.
Scoring in cow curling is done as follows:
A stone is considered "captured" if it is contained within a triangle, at the corners of which there are opponent's stones (a stone located on the border of such a triangle is also considered to be captured). A team's score is the number of stones the opposing team has "captured".
Calculate the final score of a cow curling match, given the location of all the stones.
INPUT FORMAT:
* Line 1: Integer N.
* Lines 2..1+N: Each line contains 2 integers indicating x and the y coordinates of Team A's stone (each coordinate is in the range -40,000 .. +40,000).
* Lines 2+N..1+2N: Each line contains 2 integers indicating x and the y coordinates of Team B's rock (each coordinate ranges from -40,000 .. +40,000).
OUTPUT FORMAT:
* Line 1: Two space-separated integers representing the scores of teams A and B
SAMPLE:
Enter |
Output |
4
0 0
0 2
20
2 2
1 1
1 10
-10 3
10 3 |
1 2
|
INPUT DETAILS:
Each team has 4 stones.
Team A has stones (0,0), (0,2), (2,0), (2,2).
Team B has stones (1,1), (1,10), (-10,3), (10,3).
OUTPUT DETAILS:
Team A captured the opponent's stone at (1,1).
Team B captured the opponent's stones at (0,2) and (2,2).