#P5545. [JSOI2016] 炸弹攻击2
[JSOI2016] 炸弹攻击2
Description
The game map is a two-dimensional plane. JYY's base is below the -axis, and all enemies are currently above the -axis.
In JYY's base, there are laser towers and launchers. The coordinates of the -th tower are , and the coordinates of the -th launcher are .
There are enemies on the map. The coordinates of the -th enemy are .
Two laser towers can be connected to form an energy wall. If the energy fired from a launcher toward an enemy passes through an energy wall, it can be greatly strengthened, becoming a super ray that instantly destroys the enemy.
JYY wants to know how many different attack plans can produce a super ray.
Specifically, an attack plan that can produce a super ray is a set of four points: , satisfying $1 \leq i < j \leq T,1 \leq k \leq S,1 \leq l \leq D$, and the line segment intersects the line segment .
The game guarantees that among these points, there are no duplicate points and no three points are collinear.
Input Format
The first line contains a positive integer .
The next lines each contain two integers , representing the coordinates of an enemy.
Line contains an integer .
The next lines each contain two integers , representing the coordinates of a launcher.
Line contains an integer .
The next lines each contain two integers , representing the coordinates of a laser tower.
Output Format
Output one line containing one integer: the number of attack plans that can produce a super ray.
3
1 12
10 30
30 10
1
10 -10
4
2 -11
9 -1
11 -1
15 -14
7
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, , and the absolute value of every coordinate does not exceed .
Translated by ChatGPT 5
京公网安备 11011102002149号