#P6614. 蛋糕 Cake
蛋糕 Cake
Description
Given and , find a linear function such that divides the points in the plane into two parts whose counts are in the ratio .
If you do not know why a linear function is written in this form, here is the definition of point-slope form.
Input Format
The first line contains three integers , representing the number of points and the ratio you want to split into.
The next lines each contain two integers , representing the point on the plane.
The testdata guarantees that no two points coincide.
Output Format
Output one line with three integers, representing in the statement.
You must ensure that .
If a point lies exactly on the line you give, we consider it to be above the line.
2 1 1
0 1
1 0
1 0 0
Hint
This problem uses bundled tests.
guaranteed .
guaranteed .
guaranteed , .
For all testdata, it is guaranteed that and .
Special Judge
This problem uses .
List of spj return messages:
Your answer is correct!: your result is correct.
Your answer is wrong, expected ratio as a : b, found A : B.: your function is incorrect; it splits all points into two parts with ratio instead of .
Oops, data out of range!: the coordinates or slope you provided are outside the required range.
Note that during the contest, you cannot see the return message from Special Judge.
Translated by ChatGPT 5
京公网安备 11011102002149号