#P5571. [CmdOI2019] 高塔与晶石
[CmdOI2019] 高塔与晶石
Description
He obtained three “wisdom crystals” of static geometry (of course, they contain god-level math problems), and he can place them into the towers.
Three towers with crystals placed can protect the interior of the triangle they form from invasion.
However, if the area of the triangle formed by the crystals is too large, the defense line will be very easy to break.
If the area of the triangle is too small, the geometric energy generated inside will not be enough to keep the crystals running.
After several days of calculation, the lord believes that among the possible choices, the plan with the -th smallest area is the most suitable.
(The triangle area can be .)
He is still not confident about this result, so he asks you—who can crush countless geometry problems with one hand—to help him compute the exact value of this area.
Input Format
The first line contains two integers , with the meanings as described in the statement.
The next lines: the -th line contains two numbers , representing the coordinates of tower .
Output Format
Output twice the area corresponding to the plan with the -th smallest area. It is easy to prove that this must be an integer.
4 3
2 3
3 4
4 3
3 1
3
Hint
| subtask ID | n | Notes | Score | Time Limit |
|---|---|---|---|---|
| 1 | 200 | - | 15 | 1S |
| 2 | 500 | 20 | ||
| 3 | 15 | |||
| 4 | 800 | - | 50 | 2S |
Constraints: , all coordinates are positive integers, and no two towers share the same coordinates.
Sample explanation:

Translated by ChatGPT 5
京公网安备 11011102002149号