#P2611. [ZJOI2012] 小蓝的好友
[ZJOI2012] 小蓝的好友
Description
“The essence of war between nations is the struggle to seize resources” is the core concept of the entire game, and this mini-game is no exception.
Simply put, the player needs to choose a sub-rectangle on an rectangular land.
The system randomly generates resource points; the coordinates of the -th resource point are .
The more resource points lie within the player's chosen rectangular land, the greater the reward.
Tragically, although Xiao Lan's friend is exceptionally capable, they also have terrible RP, and the region they choose always contains no resource points.
One day, Xiao Lan's friend finally decided to complain to the game's developer. To collect evidence, they want to count how many regions contain at least one resource point.
Specifically, you need to compute how many four-tuples satisfy , and there exists an such that are both true.
As Xiao Lan's friend, this is naturally your duty.
Input Format
The first line contains three positive integers .
Then there are lines; each line contains two integers , representing the coordinates of the -th resource point.
Output Format
Output a single integer on one line, the number of regions that contain at least one resource point.
5 5 4
1 2
2 3
3 5
4 1
139
Hint
- Constraints:
- For 20% of the testdata, .
- For 40% of the testdata, .
- For 100% of the testdata, , ; resource point positions are pairwise distinct and are generated randomly.
Translated by ChatGPT 5
京公网安备 11011102002149号