#P4479. [BJWC2018] 第k大斜率
[BJWC2018] 第k大斜率
Description
On the 2D Cartesian plane, there are distinct points. Any two distinct points determine a line. Among all lines whose slopes are defined, sort them by slope in descending order and find the slope of the -th line.
To avoid precision errors, please output the floor of the slope. (For example: , .)
Input Format
The first line contains two positive integers and .
Each of the next lines contains two integers , the coordinates of a point.
Output Format
Output one line containing an integer: the floor of the -th largest slope.
4 1
-1 -1
2 1
3 3
1 4
2
Hint
[Sample Explanation]
The slopes of the lines that meet the requirement are .
[Constraints]
Let be the number of lines whose slopes are defined.
- For of the testdata, .
- For of the testdata, , .
- For of the testdata, .
- For of the testdata, .
- For another of the testdata, .
- For another of the testdata, .
- For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号