#P4385. [CHCI 2009 Final Exam #2] DVAPRAVCA
[CHCI 2009 Final Exam #2] DVAPRAVCA
Description
Given points in the plane, some are red and the others are blue.
Find a pair of parallel lines (not necessarily parallel to the coordinate axes) such that there are no blue points between the lines, and the lines do not pass through any point. Among all such pairs, maximize the number of red points strictly between the lines. You only need to compute the number of red points that are between the chosen pair of parallel lines.
Input Format
The first line contains an integer , the total number of points.
Each of the next lines contains two integers and a character R (red) or B (blue), specifying the point’s coordinates and color.
Output Format
Output a single integer: the number of red points.
4
0 0 R
0 1 B
1 1 R
1 0 B
2
Hint
Constraints
- For of the testdata, .
- For of the testdata, , , and no three points are collinear.
Notes
Translated from Croatian Highschool Competitions In Informatics 2009 Final Exam #2 T1 DVAPRAVCA.
Translated by ChatGPT 5
京公网安备 11011102002149号